Nodes/ComfyUI-EditUtils/EditUtils: Flux2Klein Edit Text Encode lrzjason
ComfyUI Node

EditUtils: Flux2Klein Edit Text Encode lrzjason

Prompt, Up to Three Refs, Done

By lrzjason·Created 7 months ago·Updated 16 days ago· 207
EditUtils: Flux2Klein Edit Text Encode lrzjason
  • clip
  • vae
  • image1
  • image2
  • image3
  • mask
  • conditioning
  • latent
  • custom_output
  • main_image
  • mask
prompt
ref_longest_edge1024

Flux2KleinEditTextEncode_EditUtils is the grab-and-go entry point for editing with Flux 2 Klein in this pack. Required inputs: clip, vae, and prompt. Optional: image1, image2, image3, ref_longest_edge, and mask. Wire those up and out comes conditioning, latent, custom_output, main_image, and mask. No config nodes, no chained preparers, no dictionaries - the node builds the Klein config internally (including the vae_unit: 16 that Klein needs and Qwen-family models don't) and does the whole encode in one step.

This is the node to start with. It mirrors the older Qwen one-shot pattern but tuned for Klein, which means one deliberate absence you should notice: there's no negative_prompt and no vision-tower handling. Klein's pipeline doesn't route images through a vision tower the way Boogu does, and the pack's Klein path just doesn't carry a separate negative encode - you get the single conditioning output and that's the conditioning you use. For the CFG-1 world of distilled Klein, that's the intended flow, not a missing feature.

The mechanism under the hood is the pack's shared EditTextEncode logic: each reference image gets resized so its longest edge hits ref_longest_edge (1024 default), padded/cropped per the internal pad crop setting so dimensions align to the 16-unit VAE grid, and VAE-encoded into a reference latent. All the reference latents get attached to the conditioning object under the reference_latents key, which is how they invisibly ride into the sampler - and it's why the Flux2KleinEditApply_EditUtils node on your model path can pull them out without any extra wires. That conditioning→apply connection is the heart of the pack; get comfortable with it and every EditUtils workflow reads the same.

The outputs you'll actually use: conditioning goes straight into your sampler. latent is the main reference's latent - if your reference was the first image and it's marked as the main, this is your starting canvas, and you can VAEDecode it to preview exactly what the sampler sees. mask mirrors back the mask you fed in (it only applies to image1), and custom_output is the ANY bag holding the intermediates - pad_info, ref_latents, vae_images, the assembled full_prompt - which you can open with Flux2KleinOutputExtractor_EditUtils if you ever want them as real wires.

Fair warning for the three-image ceiling: it's real, but only on this node. If you need four-plus references or per-image crop/upscale control, switch to the chained Flux2KleinConfigPreparer_EditUtils route - same encode core, no image cap. Install: ComfyUI Manager (search "EditUtils") or git clone https://github.com/lrzjason/ComfyUI-EditUtils into custom_nodes, restart. Klein weights, Qwen3 text encoder, and VAE are yours to provide.

Categoryadvanced/conditioning

Inputs (8)

NameTypeDefaultDescription
clipCLIP
vaeVAE
promptSTRING
image1optIMAGE
image2optIMAGE
image3optIMAGE
ref_longest_edgeoptINT10248–4096Longest edge of the output latent
maskoptMASK

Outputs (5)

NameTypeDescription
conditioningCONDITIONING
latentLATENT
custom_outputANY
main_imageIMAGE
maskMASK