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
On this page
KoboldCpp image generation: what you can make
| Images from text; image to image | 1.60 | Tested 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.101 | Not run |
| Video: WAN (1.100), LTX with audio (1.114), MiniMax (1.119) | 1.100 | Not run |
| Music: ACE-Step (1.109), ACE-Step XL (1.112), YuE2 (1.124) | 1.109 | Not run |
Pick an image model
| 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.5 | One file | Untested |
| SDXL | One file; a VAE if you get black images | Untested |
| SD3 and 3.5 | Model plus text encoders and VAE | Untested |
| Flux 1, Flux 2, Kontext, Klein, Chroma | Model plus text encoder (<code>--sdllm</code>), <code>--sdclip1</code>, <code>--sdclip2</code>, <code>--sdvae</code> | Untested |
| Qwen Image and Edit, Z-Image Turbo, Ovis | Model plus text encoder and VAE | Untested |
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
Download the model
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.Fill the extra files for newer families
The text encoder goes in Image LLM, the others in the Clip and VAE boxes.Launch and watch the console
A model that cannot be used stops the start (see below).
--sdquant | Shrinks 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" />. |
--sdoffloadcpu | Keeps the model in system memory and moves it to the GPU when needed. |
--sdvramlimit (1.115) | Caps GPU memory use. |
--sdvaedevice, --sdclipdevice | Chooses where the VAE and the text encoders run. |
--sdtiledvae | Image size above which the VAE works in tiles; the default is 512. |
--sdflashattention, --sdconvdirect | Speed and memory options for the engine. |
--sdclamped | Caps 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).
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 ESRGAN upscaler model for enlarging generated images.Default Launcher Image Gen tab: Upscaler (ESRGAN)Since v1.107All details (1.107) (upstream). We checked the same functions through the API instead.
What we measured
| 256 by 256 | 1.8 | Image returned |
| 512 by 512 | 6.0 | The same seed gave the identical file; another seed a different picture |
| 768 by 768 | 21.7 | About 3.6 times the time for 2.25 times the pixels |
| Image to image, 512 | 7.9 | Image returned |
| OpenAI images, 256 | 1.5 | Image 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
| Main parameters | ||||||
|---|---|---|---|---|---|---|
| POST | /sdapi/v1/txt2img | A1111 | A1111/Forge-compatible text-to-image (also video for video models). | prompt negative_prompt cfg_scale steps width height | yes | untested |
| POST | /sdapi/v1/img2img | A1111 | A1111-compatible image-to-image and inpainting. | prompt negative_prompt cfg_scale steps width height | yes | untested |
| POST | /sdapi/v1/interrogate | A1111 | Captions an image using the loaded vision model. | image model | yes | untested |
| POST | /sdapi/v1/upscale | A1111 | Upscales an image with the ESRGAN model (--sdupscaler). | image upscaling_resize | yes | untested |
| GET | /sdapi/v1/sd-models | A1111 | Lists the loaded image model. | yes | works F23 | |
| GET | /sdapi/v1/options | A1111 | Image-generation config info. | yes | untested | |
| GET | /sdapi/v1/samplers | A1111 | Supported samplers. | yes | untested | |
| GET | /sdapi/v1/schedulers | A1111 | Supported schedulers. | yes | untested | |
| GET | /sdapi/v1/loras | A1111 | Available image LoRAs. | yes | untested | |
| GET | /sdapi/v1/upscalers | A1111 | Available upscalers (ESRGAN if loaded). | yes | untested | |
| GET | /sdapi/v1/latent-upscale-modes | A1111 | Latent upscale modes (compatibility list). | yes | untested | |
| GET | /sdapi/v1/progress | A1111 | Progress of the running image generation. | genkey skip_current_image | yes | untested |
| GET | /sdapi/v1/get_last.json | A1111 | Cached result of a previous image generation by genkey. | genkey | yes | untested |
| POST | /prompt | ComfyUI | ComfyUI-style workflow submission, mapped onto the internal image generator. | no | untested | |
| GET | /history | ComfyUI | ComfyUI-style history of generated images (also /history/<id>). | no | untested | |
| GET | /view | ComfyUI | ComfyUI-style image download (also /view_image...). | no | untested | |
| POST | /api/upload/image | ComfyUI | ComfyUI-style input image upload. | no | untested | |
| GET | /system_stats | ComfyUI | ComfyUI-style system stats stub. | no | untested | |
| GET | /object_info | ComfyUI | ComfyUI-style node info stub. | no | untested | |
| GET | /api/models/checkpoints | ComfyUI | ComfyUI-style checkpoint list. | no | untested | |
| GET | /api/models/loras | ComfyUI | ComfyUI-style LoRA list. | no | untested | |
| GET | /ws | ComfyUI | WebSocket upgrade used by ComfyUI clients for progress events. | no | untested |
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: Music language model (ACE-Step LM or YuE2) for music generation.Default Launcher Audio tab: MusicLLM / MusicEmbeds / MusicDiffuser / MusicVAESince v1.109All details, Text embedding model used by music generation (e.g. Qwen3-Embedding-0.6B).Default Launcher Audio tab: MusicLLM / MusicEmbeds / MusicDiffuser / MusicVAESince v1.109All details, Music diffusion (DiT) model, e.g. ACE-Step v1.5 turbo.Default Launcher Audio tab: MusicLLM / MusicEmbeds / MusicDiffuser / MusicVAESince v1.109All details and Music VAE / audio decoder model.Default Launcher Audio tab: MusicLLM / MusicEmbeds / MusicDiffuser / MusicVAESince v1.109All details, and Unloads music models when not generating to save VRAM.Default falseLauncher Audio tab: Music Low VRAMSince v1.109All details. The MusicUI page is at /musicui and loads without a music model F104; generating music is untested.
When it goes wrong
| <code>Could not load image model</code> then <code>Image generation failed to setup!</code>, exit 3 | The 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 memory | Use a template; try --sdquant or --sdoffloadcpu. Not reproduced by us. |
| Black or blank images | Users report a wrong or overflowing VAE | Try --sdvaeauto, or --sdvaedevice to run the VAE on the CPU. Not reproduced by us. |
| Very slow pictures | Running on the CPU: our tiny model needed 6 s for 512 by 512 and 22 s for 768 by 768 | Use 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.