Skip to content

Models & Sizes

Image Models

ModelConstantFeatures
nai-diffusion-4-5-fullV4_5_FULLLatest model, Character Reference support
nai-diffusion-4-5-curatedV4_5_CURATEDCurated V4.5, Character Reference support
nai-diffusion-4-fullV4_FULLV4 full model
nai-diffusion-4-curatedV4_CURATEDV4 curated model
nai-diffusion-3V3V3 model
nai-diffusion-3-furryV3_FURRYV3 furry model

Using Model Constants

typescript
import { NovelAI, V4_5_FULL, V4_FULL, V3 } from 'novelai-sdk-unofficial';

const client = new NovelAI();

// Using string
const images = await client.image.generate({
  prompt: '1girl',
  model: 'nai-diffusion-4-5-full',
});

// Using constant
const images = await client.image.generate({
  prompt: '1girl',
  model: V4_5_FULL,
});

Model Feature Support

FeatureV4.5V4V3
Character Reference
Multi-Character Positioning
ControlNet
Image-to-Image
Streaming

Helper Functions

typescript
import { isV4_5Model, isV4Model } from 'novelai-sdk-unofficial';

isV4_5Model('nai-diffusion-4-5-full'); // true
isV4_5Model('nai-diffusion-4-full');   // false

isV4Model('nai-diffusion-4-5-full');   // true
isV4Model('nai-diffusion-4-full');     // true
isV4Model('nai-diffusion-3');          // false

Size Presets

PresetDimensions
portrait832 × 1216
landscape1216 × 832
square1024 × 1024
large_portrait1024 × 1536
large_landscape1536 × 1024

Using Size Presets

typescript
// Using preset name
const images = await client.image.generate({
  prompt: '1girl',
  size: 'landscape',
});

// Using custom dimensions
const images = await client.image.generate({
  prompt: '1girl',
  size: [1024, 1024],
});

Custom Size Requirements

  • Width and height must be multiples of 64
  • Range: 64 to 1600 pixels
typescript
// Valid custom sizes
size: [768, 1024]   // ✅
size: [1280, 768]   // ✅

// Invalid sizes
size: [700, 1000]   // ❌ Not multiples of 64
size: [2048, 2048]  // ❌ Exceeds 1600

Size Validation

typescript
import { validateSize } from 'novelai-sdk-unofficial';

try {
  validateSize([768, 1024]); // OK
  validateSize([700, 1000]); // Throws error
} catch (error) {
  console.error(error.message);
}

Samplers

SamplerConstantDescription
k_eulerK_EULEREuler method
k_euler_ancestralK_EULER_ANCESTRALEuler ancestral (default)
k_dpm_2K_DPM_2DPM2
k_dpm_2_ancestralK_DPM_2_ANCESTRALDPM2 ancestral
k_dpmpp_2mK_DPMPP_2MDPM++ 2M
k_dpmpp_2s_ancestralK_DPMPP_2S_ANCESTRALDPM++ 2S ancestral
k_dpmpp_sdeK_DPMPP_SDEDPM++ SDE
ddimDDIMDDIM
typescript
import { NovelAI, K_DPMPP_2M } from 'novelai-sdk-unofficial';

const images = await client.image.generate({
  prompt: '1girl',
  sampler: K_DPMPP_2M,
});

Noise Schedules

Noise ScheduleDescription
karrasKarras schedule (default)
exponentialExponential schedule
polyexponentialPolyexponential schedule
typescript
const images = await client.image.generate({
  prompt: '1girl',
  noiseSchedule: 'exponential',
});

Released under the MIT License.