Models & Sizes
Image Models
| Model | Constant | Features |
|---|---|---|
nai-diffusion-4-5-full | V4_5_FULL | Latest model, Character Reference support |
nai-diffusion-4-5-curated | V4_5_CURATED | Curated V4.5, Character Reference support |
nai-diffusion-4-full | V4_FULL | V4 full model |
nai-diffusion-4-curated | V4_CURATED | V4 curated model |
nai-diffusion-3 | V3 | V3 model |
nai-diffusion-3-furry | V3_FURRY | V3 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
| Feature | V4.5 | V4 | V3 |
|---|---|---|---|
| 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'); // falseSize Presets
| Preset | Dimensions |
|---|---|
portrait | 832 × 1216 |
landscape | 1216 × 832 |
square | 1024 × 1024 |
large_portrait | 1024 × 1536 |
large_landscape | 1536 × 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 1600Size 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
| Sampler | Constant | Description |
|---|---|---|
k_euler | K_EULER | Euler method |
k_euler_ancestral | K_EULER_ANCESTRAL | Euler ancestral (default) |
k_dpm_2 | K_DPM_2 | DPM2 |
k_dpm_2_ancestral | K_DPM_2_ANCESTRAL | DPM2 ancestral |
k_dpmpp_2m | K_DPMPP_2M | DPM++ 2M |
k_dpmpp_2s_ancestral | K_DPMPP_2S_ANCESTRAL | DPM++ 2S ancestral |
k_dpmpp_sde | K_DPMPP_SDE | DPM++ SDE |
ddim | DDIM | DDIM |
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 Schedule | Description |
|---|---|
karras | Karras schedule (default) |
exponential | Exponential schedule |
polyexponential | Polyexponential schedule |
typescript
const images = await client.image.generate({
prompt: '1girl',
noiseSchedule: 'exponential',
});