Generated reference · ComfyUI workflow · chroma

FLUX.2 klein 4B Edit

Edit a source image by instruction with FLUX.2 klein 4B (the distilled 4-step model, bf16) on the RunPod image endpoint, optionally guided by a second reference image, SFW only. Translated from Comfy-Org/workflow_templates@aaac56dd …

chroma24nodesGPU A5000out image~6sv1.0.0

On this page

Edit a source image by instruction with FLUX.2 klein 4B (the distilled 4-step model, bf16) on the RunPod image endpoint, optionally guided by a second reference image, SFW only. Translated from Comfy-Org/workflow_templates@aaac56dd templates/image_flux2_klein_image_edit_4b_distilled.json, whose two subgraphs take one and two images; two is the most the template accepts. Each image goes through ImageScaleToTotalPixels (nearest-exact, 1 MP, resolution_steps 1) and VAEEncode (flux2-vae) into a ReferenceLatent on the positive and another on the zeroed negative, the second image chained after the first; the output takes the scaled source's size through GetImageSize into Flux2Scheduler and EmptyFlux2LatentImage; CFGGuider at CFG 1, KSamplerSelect euler, Flux2Scheduler at 4 steps. The template loads the fp8 transformer; this catalog loads the bf16 file on the volume.

24Graph nodes
18Node classes
5Inputs
3Models

Tags: chromarunpod-serverlessvolume-backedimage-to-imageimage-editflux2-klein

Inputs (5)#

The typed parameter surface callers bind when they request this workflow. Enum options and numeric bounds are the values the workflow document declares.

promptstringrequireddefault Change the bag color to blue.
The edit instruction in natural prose (the default is the upstream template's). With a reference image, name the images as the template's two-image example does ("the handbag in image 1 with the colours and logo from image 2"). There is no negative prompt: the distilled model samples at CFG 1 with the negative zeroed.
seedintegerdefault -1
Random seed (-1 = random)
source_imageimagerequired
Image 1, the one being edited. It is scaled to ~1 MP (nearest-exact, as the template does) and the output takes its size.
referencesenumdefault one
How many images the edit reads: one = source_image only (the template's one-image subgraph); two = source_image then reference_image (its two-image subgraph, the most the template accepts). two needs reference_image, and a job without it is refused when the graph is rendered, before submission.
options: onetwo
reference_imageimage
Image 2 for references two: a second reference (for example the colours or logo to apply), scaled to ~1 MP the same way and attached after image 1. Not read with references one.

ComfyUI node graph (24)#

The executable ComfyUI prompt graph: 24 nodes across 18 distinct node classes, wired by 32 data dependencies. Nodes tinted green come from a custom node pack this workflow declares; the rest are ComfyUI core / baked-community classes.

flowchart TD n0["1: UNETLoader"] n1["2: CLIPLoader"] n2["3: VAELoader"] n3["4: CLIPTextEncode"] n4["5: ConditioningZeroOut"] n5["6: LoadImage"] n6["7: ImageScaleToTotalPixels"] n7["8: VAEEncode"] n8["9: ReferenceLatent"] n9["10: ReferenceLatent"] n10["11: LoadImage"] n11["12: ImageScaleToTotalPixels"] n12["13: VAEEncode"] n13["14: ReferenceLatent"] n14["15: ReferenceLatent"] n15["16: CFGGuider"] n16["17: KSamplerSelect"] n17["18: GetImageSize"] n18["19: Flux2Scheduler"] n19["20: RandomNoise"] n20["21: EmptyFlux2LatentImage"] n21["22: SamplerCustomAdvanced"] n22["23: VAEDecode"] n23["24: SaveImage"] n1 -->|clip| n3 n3 -->|conditioning| n4 n5 -->|image| n6 n6 -->|pixels| n7 n2 -->|vae| n7 n3 -->|conditioning| n8 n7 -->|latent| n8 n4 -->|conditioning| n9 n7 -->|latent| n9 n10 -->|image| n11 n11 -->|pixels| n12 n2 -->|vae| n12 n8 -->|conditioning| n13 n12 -->|latent| n13 n9 -->|conditioning| n14 n12 -->|latent| n14 n0 -->|model| n15 n13 -->|positive| n15 n14 -->|negative| n15 n6 -->|image| n17 n17 -->|width| n18 n17 -->|height| n18 n17 -->|width| n20 n17 -->|height| n20 n19 -->|noise| n21 n15 -->|guider| n21 n16 -->|sampler| n21 n18 -->|sigmas| n21 n20 -->|latent_image| n21 n21 -->|samples| n22 n2 -->|vae| n22 n22 -->|images| n23
Data-flow DAG — scroll to zoom, drag to pan.

Nodes (24)#

1UNETLoadercore
unet_name = flux-2-klein-4b.safetensorsweight_dtype = default
outputs: MODEL
2CLIPLoadercore
clip_name = qwen_3_4b.safetensorstype = flux2device = default
outputs: CLIP
3VAELoadercore
vae_name = flux2-vae.safetensors
outputs: VAE
4CLIPTextEncodecore
text = {{constructed_prompt}} tmplclip = ◂ node 2 · out[0]
outputs: CONDITIONING
5ConditioningZeroOutcore
conditioning = ◂ node 4 · out[0]
outputs: CONDITIONING
6LoadImagecore
image = {{source_image}} tmpl
outputs: IMAGEMASK
7ImageScaleToTotalPixelscore
image = ◂ node 6 · out[0]upscale_method = nearest-exactmegapixels = 1.0resolution_steps = 1
outputs: IMAGE
8VAEEncodecore
pixels = ◂ node 7 · out[0]vae = ◂ node 3 · out[0]
outputs: LATENT
9ReferenceLatentcore
conditioning = ◂ node 4 · out[0]latent = ◂ node 8 · out[0]
outputs: CONDITIONING
10ReferenceLatentcore
conditioning = ◂ node 5 · out[0]latent = ◂ node 8 · out[0]
outputs: CONDITIONING
11LoadImagecore
image = {{reference_image}} tmpl
outputs: IMAGEMASK
12ImageScaleToTotalPixelscore
image = ◂ node 11 · out[0]upscale_method = nearest-exactmegapixels = 1.0resolution_steps = 1
outputs: IMAGE
13VAEEncodecore
pixels = ◂ node 12 · out[0]vae = ◂ node 3 · out[0]
outputs: LATENT
14ReferenceLatentcore
conditioning = ◂ node 9 · out[0]latent = ◂ node 13 · out[0]
outputs: CONDITIONING
15ReferenceLatentcore
conditioning = ◂ node 10 · out[0]latent = ◂ node 13 · out[0]
outputs: CONDITIONING
16CFGGuidercore
model = ◂ node 1 · out[0]positive = ◂ node 14 · out[0]negative = ◂ node 15 · out[0]cfg = 1.0
outputs: GUIDER
17KSamplerSelectcore
sampler_name = euler
outputs: SAMPLER
18GetImageSizecore
image = ◂ node 7 · out[0]
outputs: INTINTINT
19Flux2Schedulercore
steps = 4width = ◂ node 18 · out[0]height = ◂ node 18 · out[1]
outputs: SIGMAS
20RandomNoisecore
noise_seed = {{seed}} tmpl
outputs: NOISE
21EmptyFlux2LatentImagecore
width = ◂ node 18 · out[0]height = ◂ node 18 · out[1]batch_size = 1
outputs: LATENT
22SamplerCustomAdvancedcore
noise = ◂ node 20 · out[0]guider = ◂ node 16 · out[0]sampler = ◂ node 17 · out[0]sigmas = ◂ node 19 · out[0]latent_image = ◂ node 21 · out[0]
outputs: LATENTLATENT
23VAEDecodecore
samples = ◂ node 22 · out[0]vae = ◂ node 3 · out[0]
outputs: IMAGE
24SaveImagecore
images = ◂ node 23 · out[0]filename_prefix = isis/klein4b-edit

Prompt construction#

template
{base_prompt}

Variables (1)#

base_prompt
{{prompt}} tmpl

Parameter banks (1)#

The prompt / configuration lookup tables this workflow keys into from its inputs — the vocabulary that turns a style / palette / preset selection into graph parameters.

requires_families (1)#

klein4b

Models & dependencies#

Models required (3)#

flux-2-klein-4b.safetensors
qwen_3_4b.safetensors
flux2-vae.safetensors

Output contract#

What a successful run of this workflow returns.

type
image
format
png

Taxonomy & routing#

How the control plane classifies this workflow — from the committed workflow-taxonomy-registry.json. It drives the consistency / control surface the agentic director can exercise over the workflow.

assetFamily
portrait-hero-image-bundle
outputPackageProfile
image-single-profile
controlModalities
model-locksampler-scheduler-lockseed-locklatent-reuse
consistencyDimensions
identitylightingenvironment
notes
FLUX.2 klein 4B distilled instruction edit with up to two reference images, SFW only.