Generate images (and video and music) with KoboldCpp

Yes, KoboldCpp makes images with its built-in stable-diffusion.cpp engine. The easiest start is a ready-made .kcppt template that downloads the models for you, or put an SD 1.5 or SDXL model file in the launcher's Image Gen tab (--sdmodel). Then generate in KoboldAI Lite or in StableUI at http://localhost:5001/sdui. Flux, SD3, Qwen Image and Z-Image need extra text-encoder and VAE files. We tested the whole path on a CPU with a tiny model: 512 by 512 in about 6 seconds.

Checked against KoboldCpp 1.124.2 · updated 13 Nov 2026
  • lab-lnx: Linux test VM · 4 vCPU · 15 GB · no GPU
  • gha-u24: Ubuntu 24.04 test machine · 4 vCPU · 16 GB · no GPU
How we test
On this page
  1. KoboldCpp image generation: what you can make
  2. Pick an image model
  3. The quick way: a template
  4. Set it up by hand
  5. Generate in KoboldAI Lite
  6. Generate in StableUI
  7. What we measured
  8. Use it from other apps
  9. SillyTavern image generation
  10. Video
  11. Music
  12. When it goes wrong

KoboldCpp image generation: what you can make

What the image engine covers (upstream release notes)
Images from text; image to image1.60Tested on CPU with a tiny model <EvidenceBadge id="F88" />
Inpainting (1.88), PhotoMaker (1.94), Flux Kontext (1.95), Qwen Image Edit (1.101)1.88 to 1.101Not run
Video: WAN (1.100), LTX with audio (1.114), MiniMax (1.119)1.100Not run
Music: ACE-Step (1.109), ACE-Step XL (1.112), YuE2 (1.124)1.109Not run

Pick an image model

Image model families (upstream list); only the tiny model was run by us
SD-XS 512 (tiny, distilled)One file (<code>--sdmodel</code>)Works on CPU: 512 by 512 in about 6 s <EvidenceBadge id="F88" />
SD 1.5One fileUntested
SDXLOne file; a VAE if you get black imagesUntested
SD3 and 3.5Model plus text encoders and VAEUntested
Flux 1, Flux 2, Kontext, Klein, ChromaModel plus text encoder (<code>--sdllm</code>), <code>--sdclip1</code>, <code>--sdclip2</code>, <code>--sdvae</code>Untested
Qwen Image and Edit, Z-Image Turbo, OvisModel plus text encoder and VAEUntested

We could not run a family that needs several gigabytes of memory, so we give no memory or speed figure for them and no “best model”. Memory needs grow quickly with size: use the model’s own card. Name history: the text-encoder flag --sdllm was --sdt5xxl until 1.122 (renamed flags).

The quick way: a template

A .kcppt is a shareable launch template; the official ones on Hugging Face under koboldcpp download the model files together (what a template is). Open one with Load Config or the launcher’s Get Help menu, or start with --config <link>, which downloads it first (upstream; we did not run a template). The Colab notebook has image presets (Colab).

Set it up by hand

  1. Download the model

    From Hugging Face; check the licence. Image models may be .safetensors or .gguf.
  2. Open the Image Gen tab

    Choose the file in Image Model. The tab also has Image LLM, Clip-1, Clip-2, Image VAE, Compress Weights, Model Offload and VRAM Limiter boxes, which we saw in the launcher on Windows F39.
  3. Fill the extra files for newer families

    The text encoder goes in Image LLM, the others in the Clip and VAE boxes.
  4. Launch and watch the console

    A model that cannot be used stops the start (see below).
  5. Check the flag

    /api/extra/version must show "txt2img": true. Without an image model it shows false and /sdapi/v1/sd-models is empty F23. With our model it showed true and listed the model F88.
Memory and speed controls (names from the flag list; effects not measured by us unless stated)
--sdquantShrinks the image model weights (0 off, 1 or 2 on). On our tiny model 2 still made a picture, a different one <EvidenceBadge id="F88" />.
--sdoffloadcpuKeeps the model in system memory and moves it to the GPU when needed.
--sdvramlimit (1.115)Caps GPU memory use.
--sdvaedevice, --sdclipdeviceChooses where the VAE and the text encoders run.
--sdtiledvaeImage size above which the VAE works in tiles; the default is 512.
--sdflashattention, --sdconvdirectSpeed and memory options for the engine.
--sdclampedCaps the image size a request may ask for: with 256 a 512 by 512 request came back 256 by 256 <EvidenceBadge id="F88" />.

Generate in KoboldAI Lite

Image settings are in Lite’s Settings, Media tab. The Image Backend can be Disabled, AI Horde, KCPP / Forge / A1111, OpenAI Compatible Img, ComfyUI or Pollinations.ai. With an image model loaded in KoboldCpp, Lite had already chosen “KCPP / Forge / A1111” and listed our model F104. Defaults: 20 steps, CFG scale 5, sampler Euler, resolution 512 x 512, clip skip -1, image-to-image strength 0.6, “Autogenerate images” Off (Off, Basic or Smart). We did generate one from inside Lite F105: the Add File button opens an “Add Audio or Image” box, and its Generate Image, Automatic button sent the last AI reply as the prompt to /sdapi/v1/txt2img (20 steps, Euler) and showed the picture under that reply. “From Prompt” lets you type the prompt instead (Lite).

Lite Add File menu: generate image, generate speech, capture, upload.gha-u24-lite-addfile-menu-01 · gha-u24 · KoboldCpp 1.124.2 · 14 Nov 2026
Lite Add Audio or Image dialog with Generate Image, Generate Speech, Capture From, Upload a File and Customize Media Settings
A picture made inside Lite with the Automatic button, shown under the last reply.gha-u24-lite-image-generated-01 · gha-u24 · KoboldCpp 1.124.2 · 14 Nov 2026
Lite chat with a model reply and a small generated picture of a woman reading a book under it
Lite settings, Media tab: image backend (found the loaded image model by itself), image options and text to speech.gha-u24-lite-settings-media-01 · gha-u24 · KoboldCpp 1.124.2 · 14 Nov 2026
Lite Settings Media tab with the KCPP, Forge, A1111 image backend, the sdxs model, step count, CFG scale and text to speech

Generate in StableUI

StableUI is at http://localhost:5001/sdui (since 1.65) and answered 200 in our run F88. It does text to image, image to image, inpainting (1.88) and upscaling with (1.107) (upstream). We checked the same functions through the API instead.

StableUI, the image page served at /sdui.gha-u24-stableui-01 · gha-u24 · KoboldCpp 1.124.2 · 14 Nov 2026
StableUI page with Generate, Images, About and Options tabs, a prompt box, seed, sampler and scheduler

What we measured

sdxs-512 Q8_0, CPU with 4 threads, KoboldCpp 1.124.2
256 by 2561.8Image returned
512 by 5126.0The same seed gave the identical file; another seed a different picture
768 by 76821.7About 3.6 times the time for 2.25 times the pixels
Image to image, 5127.9Image returned
OpenAI images, 2561.5Image returned

This model is built for one step: asking for four gave the identical picture in the same time. Other models use the step count.

Use it from other apps

KoboldCpp API routes
Main parameters
POST/sdapi/v1/txt2imgA1111A1111/Forge-compatible text-to-image (also video for video models).prompt negative_prompt cfg_scale steps width heightyesuntested
POST/sdapi/v1/img2imgA1111A1111-compatible image-to-image and inpainting.prompt negative_prompt cfg_scale steps width heightyesuntested
POST/sdapi/v1/interrogateA1111Captions an image using the loaded vision model.image modelyesuntested
POST/sdapi/v1/upscale
also /sdapi/v1/extra-single-image
A1111Upscales an image with the ESRGAN model (--sdupscaler).image upscaling_resizeyesuntested
GET/sdapi/v1/sd-modelsA1111Lists the loaded image model.–yesworks F23
GET/sdapi/v1/optionsA1111Image-generation config info.–yesuntested
GET/sdapi/v1/samplersA1111Supported samplers.–yesuntested
GET/sdapi/v1/schedulersA1111Supported schedulers.–yesuntested
GET/sdapi/v1/lorasA1111Available image LoRAs.–yesuntested
GET/sdapi/v1/upscalersA1111Available upscalers (ESRGAN if loaded).–yesuntested
GET/sdapi/v1/latent-upscale-modesA1111Latent upscale modes (compatibility list).–yesuntested
GET/sdapi/v1/progressA1111Progress of the running image generation.genkey skip_current_imageyesuntested
GET/sdapi/v1/get_last.jsonA1111Cached result of a previous image generation by genkey.genkeyyesuntested
POST/promptComfyUIComfyUI-style workflow submission, mapped onto the internal image generator.–nountested
GET/history
also /api/history
ComfyUIComfyUI-style history of generated images (also /history/<id>).–nountested
GET/view
also /view.png, /api/view
ComfyUIComfyUI-style image download (also /view_image...).–nountested
POST/api/upload/image
also /upload/image
ComfyUIComfyUI-style input image upload.–nountested
GET/system_statsComfyUIComfyUI-style system stats stub.–nountested
GET/object_infoComfyUIComfyUI-style node info stub.–nountested
GET/api/models/checkpoints
also /models/checkpoints
ComfyUIComfyUI-style checkpoint list.–nountested
GET/api/models/loras
also /models/loras
ComfyUIComfyUI-style LoRA list.–nountested
GET/wsComfyUIWebSocket upgrade used by ComfyUI clients for progress events.–nountested

KoboldCpp answers the A1111-style /sdapi/v1/* routes (SillyTavern uses these), a subset of ComfyUI’s routes (since 1.79; it is not ComfyUI) and OpenAI’s /v1/images/generations. We called txt2img, img2img, sd-models and the OpenAI route F88.

SillyTavern image generation

SillyTavern’s image feature can use an A1111-compatible source pointed at http://localhost:5001. We did not test it; see SillyTavern.

Video

Upstream lists WAN 2.2 (1.100), LTX 2.3 with --sdaudiovae (1.114) and MiniMax H3 (1.119), loaded with --sdmodel and --sdllm. They need a lot of memory. untested We ran none and give no numbers.

Music

Upstream lists ACE-Step (1.109), ACE-Step XL (1.112) and YuE2 (1.124) with four files: , , and , and . The MusicUI page is at /musicui and loads without a music model F104; generating music is untested.

MusicUI, the music page served at /musicui.gha-u24-musicui-01 · gha-u24 · KoboldCpp 1.124.2 · 14 Nov 2026
MusicUI page of KoboldCpp

When it goes wrong

Image problems
<code>Could not load image model</code> then <code>Image generation failed to setup!</code>, exit 3The file is not an image model (we reproduced it with a text model) or its companion files are missing <EvidenceBadge id="F88" />Check the file, add the text encoder and VAE for newer families, or use a template.
<code>Failed to create context</code>Users report missing encoders or VAE, or running out of memoryUse a template; try --sdquant or --sdoffloadcpu. Not reproduced by us.
Black or blank imagesUsers report a wrong or overflowing VAETry --sdvaeauto, or --sdvaedevice to run the VAE on the CPU. Not reproduced by us.
Very slow picturesRunning on the CPU: our tiny model needed 6 s for 512 by 512 and 22 s for 768 by 768Use a GPU backend ([backends](/backends/)); lower the size.

Other messages are in the error list.

Frequently asked questions

Can KoboldCpp generate images?

Yes. It includes the stable-diffusion.cpp engine. Load an image model with --sdmodel or in the Image Gen tab; on our CPU-only test machine a tiny model made a 512 by 512 picture in about 6 seconds.

Which image model should I download?

Start with a model your memory can hold: SD 1.5 and SDXL are single files. Flux, SD3, Qwen Image and Z-Image need extra files. We tested only a tiny model, so we do not rank the big ones.

Why do I get a black image?

Users report a wrong or overflowing VAE as the usual cause, and --sdvaeauto or moving the VAE to the CPU with --sdvaedevice as fixes. We did not reproduce a black image.

What does Could not load image model mean?

The file you gave cannot be used as an image model, or its companion files are missing. We reproduced it by giving a text model: the message was Could not load image model, then Image generation failed to setup, exit code 3.

Can KoboldCpp make video or music?

Upstream lists video models (WAN, LTX, MiniMax) and music models (ACE-Step, YuE) through the same engine. We did not run either.

Does the password protect image generation?

Upstream says image endpoints are not protected by --password. Treat an exposed server as open for pictures.