Nodes/IAMCCS-nodes/Flux Klein Multi-Gen
ComfyUI Node

Flux Klein Multi-Gen

One image, a dozen prompts, zero duplicated sampling chains

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
Flux Klein Multi-Gen
  • model
  • clip
  • vae
  • image
  • images
  • count
multi_prompt
seed0
steps8
cfg1.00
sampler_name
separator\n
reference_latents_methodworkflow_default
target_megapixels1.0
upscale_methodnearest-exact
negative_prompt
output_prefixflux_klein_multi
save_imagesfalse
resolution_steps1
output_width720
output_height1024
debug_enabledfalse
debug_prefixflux_klein_debug
defer_cpu_transferfalse

There's a workflow pattern that everyone ends up rebuilding by hand: take one reference image, run it through Flux with ten different prompts, and get ten variations. The standard way is to copy-paste the entire sampling chain ten times, which is how graphs turn into spaghetti. Flux Klein Multi-Gen compresses that into a single node - it takes a multi_prompt with one prompt per line and runs them all through one loop, sharing the expensive parts (VAE encode, reference latents) across every variant.

The timing makes sense too. Flux 2 Klein is the size-distilled Apache-2.0 Flux that finally runs on consumer cards - around 13GB of VRAM quantized - so a batch-of-variations node for it is the right tool at the right moment. It's the sibling of IAMCCS_QwenMultiGen in the pack's dataset-creation workflow, built for turning one "edit this image" slot into a structured multi-view batch.

How it works

The node mirrors a reference Flux edit pipeline internally, but shares the setup across prompts:

  1. Your image is scaled to target_megapixels and VAE-encoded once - that shared latent is the reference for every variant.
  2. The negative prompt is encoded once and combined with the reference latent.
  3. For each line in multi_prompt, it encodes the positive prompt, applies the reference latent method, and runs a sampling step with your seed (offset per variant), steps, cfg, and sampler_name.
  4. Results batch together into a single images output, with count telling you how many you got.

The optional reference_latents_method lets you override how the reference is attached - workflow_default keeps the reference behavior, and the others (index_timestep_zero, offset, index, uxo/uno) switch the injection strategy for different editing styles. You can also drive output_width/output_height, enable save_images with an output_prefix, and turn on debug_enabled to get a JSONL trace of every run.

Inputs that matter

  • model, clip, vae, image - the usual Flux edit wiring.
  • multi_prompt - the whole point. One prompt per line (change separator if your prompts contain newlines).
  • seed - set it once; variants get derived seeds so they're reproducible but distinct.
  • steps (default 8) and cfg (default 1.0) - Klein is a flow model, low step count is normal here.

Install

Part of IAMCCS-nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Or ComfyUI Manager → "IAMCCS" → install → restart. You still need a Flux 2 Klein model (and a text encoder) in your models folder - this node doesn't download one.

Gotchas

Klein is a vision-language-encoder model, so the quality of your reference latents does most of the work; if every variant drifts, fix the reference method before blaming your prompts. And mind the VRAM: shared encoding helps, but N prompts still means N sampling passes, so resolution_steps and target_megapixels are your levers on runtime. Also worth knowing: the pack is a solo dev's fast-moving project, so if a shared workflow references this node, keep the pack updated.

CategoryIAMCCS/Flux

Inputs (22)

NameTypeDefaultDescription
modelMODEL
clipCLIP
vaeVAE
imageIMAGE
multi_promptSTRING
seedINT00–18446744073709550000
stepsINT81–100
cfgFLOAT1.000–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
separatoroptSTRING\n
reference_latents_methodoptCOMBOworkflow_default5 options: workflow_default, index_timestep_zero, offset, index, uxo/uno
target_megapixelsoptFLOAT1.00.1–16
upscale_methodoptCOMBOnearest-exact5 options: nearest-exact, bilinear, area, bicubic, lanczos
negative_promptoptSTRING
output_prefixoptSTRINGflux_klein_multi
save_imagesoptBOOLEANfalse
resolution_stepsoptINT11–256
output_widthoptINT72016–8192
output_heightoptINT102416–8192
debug_enabledoptBOOLEANfalse
debug_prefixoptSTRINGflux_klein_debug
defer_cpu_transferoptBOOLEANfalse

Outputs (2)

NameTypeDescription
imagesIMAGE
countINT