stable-diffusion.cpp/docs/models/z_image_l2p.md

3.2 KiB

Z-Image L2P

L2P (Latent-to-Pixel) generates images directly in pixel space using Z-Image-Turbo and Qwen3 4B. No VAE is required.

Model files

Component Weights and downloads CLI option Requirement
L2P (1K) Safetensors --diffusion-model Required
Qwen3 4b Safetensors
GGUF
--llm Use matching text encoder

Usage

Web UI

Follow the Web UI guide to start the server, then select the recipe matching your weights. Fill the component slots below and click Load models. Use the files and compatibility requirements in Model files.

Recipe Component slots
Z-Image L2P (z-image-l2p) diffusion_model, llm

Slot IDs correspond to CLI component options: diffusion_model uses --diffusion-model, llm uses --llm, and model uses -m / --model. Select optional components when required by your checkpoint or task.

DGL

Example Description
Text to image Z-Image L2P generation.

Run a script

Edit paths, prompts and settings in the script's var block, then run from the build directory. Paths inside the script resolve from the working directory.

Windows (PowerShell)

.\bin\Release\sd-cli.exe -M dgl --script ..\docs\dgl\z_image_l2p\z-image-l2p-txt2img.dgl

Linux/macOS

./bin/sd-cli -M dgl --script ../docs/dgl/z_image_l2p/z-image-l2p-txt2img.dgl

Choose another script from the table to run a different task. Add --check to validate syntax and types without loading weights. See the shared run instructions for build paths and the server's file-access rules.

Legacy CLI

CLI examples use the shared path and shell conventions.

Text-to-image

Do not pass --vae. Image dimensions must be multiples of 16. The reference pipeline uses 30 steps with a CFG scale of 2.0.

The released checkpoint keeps part of the transformer in F32. Pass --type bf16 to load it in BF16, as the reference pipeline runs it; this reduces the diffusion model from about 18.6 GB to 11.8 GB.

Windows (PowerShell)

.\bin\Release\sd-cli.exe `
  --diffusion-model ..\models\diffusion_models\model-1k-merge.safetensors `
  --llm ..\models\text_encoders\qwen_3_4b.safetensors `
  --type bf16 `
  -p "an origami pig on fire in the middle of a dark room with a pentagram on the floor" `
  --cfg-scale 2.0 `
  --steps 30 `
  --sampling-method euler `
  -W 1024 `
  -H 1024 `
  -v `
  -o z_image_l2p.png

Linux/macOS

./bin/sd-cli \
  --diffusion-model ../models/diffusion_models/model-1k-merge.safetensors \
  --llm ../models/text_encoders/qwen_3_4b.safetensors \
  --type bf16 \
  -p "an origami pig on fire in the middle of a dark room with a pentagram on the floor" \
  --cfg-scale 2.0 \
  --steps 30 \
  --sampling-method euler \
  -W 1024 \
  -H 1024 \
  -v \
  -o z_image_l2p.png