Nodes/ComfyUI_ZImageI2L_v2/Z-Image i2L v2 — Sample
ComfyUI Node

Z-Image i2L v2 — Sample

Pipe and LoRA in, image out

By jzhang-POP·Created 3 months ago·Updated 3 months ago· 6
Z-Image i2L v2 — Sample
  • pipe
  • lora
  • negative_lora
  • image
prompta cat is sitting on a stone
seed0
cfg_scale4.0
num_inference_steps50
sigma_shift8.0
width1024
height1024
negative_prompt

If Generate is the "give me a good image, please" button, Sample is the one that puts the knobs in your hands. It's modeled directly on ComfyUI's KSampler: you feed it the pipeline and a positive LoRA, optionally a negative LoRA, and it runs diffusion sampling with its own widgets for everything else. This is the node you use when you're assembling the atomic workflow by hand instead of taking the all-in-one Generate path.

The inputs: pipe (from the Loader), lora (the positive branch - typically Extract LoRA on your reference images), prompt, seed, cfg_scale (4), num_inference_steps (50), sigma_shift (8), and width/height (both 1024, stepped by 16). The optional negative_lora is the interesting one: feed it a gray-image LoRA - Gray Images → Extract LoRA - for the asymmetric CFG the paper describes. Leave it unconnected and you get symmetric CFG, which is simpler but flatter and less stylized. negative_prompt also does real work here, because this is the base z-image at CFG 4; unlike Turbo's guidance-distilled CFG 1, the negative branch is active and audible.

Why it exists: it's the same computation Generate runs, minus the automatic gray-negative branch. The trade is control and composability for the convenience of not building the two extract branches yourself. The pack's atomic example workflow shows the full graph: folder → references (positive) and gray references (negative) → two Extract LoRA nodes → this Sample node. That's the whole pack laid bare, and Sample is the sink everything funnels into.

Notes that trip people up: the defaults are base-z-image values, so don't copy Turbo's 8-step, CFG-1 habits over. Width and height want multiples of 16. And if the output looks weak, the first thing to check isn't the prompt - it's whether negative_lora is connected, because that asymmetric branch is doing most of the style work. Feeding it a saved-and-reloaded LoRA instead of a fresh Extract output also costs you the quality the in-memory path keeps (same story the README tells about Generate vs. Save).

Install

Installs as part of the pack: ComfyUI Manager (search ComfyUI_ZImageI2L_v2) or git clone https://github.com/jzhang-POP/ComfyUI_ZImageI2L_v2 into ComfyUI/custom_nodes/. The dependency that bites is DiffSynth-Studio, which must come from git because v2 needs its Diffusion Templates API (diffsynth.diffusion.template.TemplatePipeline):

git clone https://github.com/modelscope/DiffSynth-Studio.git
cd DiffSynth-Studio && pip install -e . && cd ..
pip install -r ComfyUI/custom_nodes/ComfyUI_ZImageI2L_v2/requirements.txt

Restart ComfyUI, then run the Loader once so the models (tens of GB from ModelScope, one-time) are on disk before you sample.

CategoryZImage-i2L/atomic

Inputs (11)

NameTypeDefaultDescription
pipeZIMAGE_PIPEThe Z-Image pipeline from Loader.
loraZIMAGE_LORAPositive-branch LoRA, e.g. from Extract LoRA on the reference images.
promptSTRINGa cat is sitting on a stone
seedINT00–18446744073709550000
cfg_scaleFLOAT4.00–30
num_inference_stepsINT501–200
sigma_shiftFLOAT8.00–20
widthINT1024256–4096
heightINT1024256–4096
negative_loraoptZIMAGE_LORANegative-branch LoRA (e.g. Extract LoRA on Gray Images) for asymmetric CFG. Leave unconnected for symmetric.
negative_promptoptSTRING

Outputs (1)

NameTypeDescription
imageIMAGE