u/Capitan01R-

Prompting Tips Flux.2-Klein
▲ 119 r/FluxAI+2 crossposts

Prompting Tips Flux.2-Klein

For Klein 9B using the qwen_3_8b, the prompt path is basically:

your prompt;

1-wrapped in Qwen chat template

2 - Qwen2 tokenizer

3- Qwen3 8B text encoder

4- hidden layers [9, 18, 27] stacked into conditioning

5- Flux2/Klein transformer cross-attends to that

The local wrapper does this template:

  <|im_start|>user
  YOUR PROMPT<|im_end|>
  <|im_start|>assistant
  <think>

  </think>

So it is not reading your prompt like CLIP tags. It is reading it like an instruction/message.

What It Accepts Well:

It should respond best to natural language with clear relationships:

A woman sitting on a beachfront, looking at the camera, wearing a black dress. The camera is at eye level. Her body is seated facing slightly left. The beach and ocean are behind her.

Strong prompt concepts:

- subject type: woman, man, dog, car

- action/pose: sitting, standing, walking, looking at camera

- location: on a beach, inside a kitchen

- spatial relations: behind her, to her left, in the foreground

- clothing/object attribution: she is wearing, holding, beside

- camera/framing: close-up, full body, eye-level, three-quarter view

- style if phrased plainly: photo, natural lighting, soft shadows

What It Throws Away Or Weakens

The big one: Comfy prompt weighting is disabled for this TE.

So this does not mean much:

((face:1.4)), [body:0.6], (((identity)))

The tokenizer still sees punctuation/text, but the encoder wrapper passes disable_weights=True, so classic CLIP-style

emphasis is not applied as weights.

Also weak:

- giant comma tag soups

- repeated words as fake emphasis

- abstract junk like masterpiece, best quality, ultra detailed

- contradictions: sitting, standing, walking

- vague modifiers not attached to a noun: beautiful, perfect, cinematic

- negative prompt logic, unless the sampler/model path explicitly uses it well

- overly long prompts where important instructions are buried

What Matters Most

Because this is Qwen-style chat encoding, write prompt chunks as sentences with ownership:

Bad:

beach, woman, camera, sitting, black dress, looking, ocean, realistic

Better:

A realistic photo of a woman sitting on a beach. She is looking at the camera. She is wearing a black dress. The ocean is behind her.

For identity/reference workflows "Identity feature transfer", avoid asking the TE to redefine the subject too much. Let the node carry identity, and let prompt carry scene/action:

Keep the same woman. Change only the location: she is sitting on a beachfront, looking at the camera. Natural daylight photo.

Best Prompt Shape For Your Use:

Use this structure:

[identity constraint].

[scene/location change].

[pose/action].

[clothing/body constraint].

[camera/framing].

[lighting/style].

Example:

Keep the same woman from the reference image.
Move her to a sunny beachfront.
She is sitting and looking directly at the camera.
Preserve her face, body proportions, hairstyle, and clothing shape.
Eye-level photo, natural daylight, realistic beach background.

The TE will not literally “obey” every clause, but this format gives Qwen the best chance to encode relationships instead of treating the prompt as a bag of tags.

u/Capitan01R- — 5 days ago

Flux.2Klein Best open source image edit - work in progress

this model knows how to transfer character 1:1 I am currently working on a more flexible edit, because if it knows this much there is a big chance on getting that 1:1 editing system, the subtle shift you see when u zoom in is from the ImageScaleToTotalPixels as I am doing it at 1mb

u/Capitan01R- — 14 days ago
▲ 216 r/FluxAI+2 crossposts

Identity Feature Transfer now has a V3 version:

This is the cleaner version of the identity transfer node. The goal was to make it easier to use without forcing everyone to understand every block and every hook inside FLUX.2 Klein.

FLUX.2 Klein Identity Feature Transfer V3 : Here

Workflow : here

If you find my work helpful you can support me and buy me a coffee

V3 is built around presets now.

MIDUM_LOCK is the starting point ((spelt it wrong lol but not going to change that)).

HARD_LOCK is for stronger preservation when the reference keeps drifting.

SOFT_LOCK is for when the reference is taking over too much.

custom is there if you want to use your own block schedules and values.

The big change is the commit system.

Instead of constantly averaging the generation toward the whole reference, V3 tries to find the best reference match for each generation token. If that match stays stable, it commits to it. After that, it keeps a lighter anchor instead of pulling hard forever.

That means less feature mush, less random background bleed, and cleaner identity preservation.

The presets override the manual settings on purpose. If you pick MIDUM_LOCK, HARD_LOCK, or SOFT_LOCK, you do not need to touch the rest unless you want to experiment. If you pick custom, then the manual controls are used.

Controls if you use custom:

double_schedule: controls the double blocks. These are important for identity and structure. Format is like 0-3:mid=0.25; 4:mid=0.35

single_schedule: controls the single blocks. These help carry the identity through the later fused stream. Format is like 0:mid=0.35; 1:mid=0.25; 2-10:mid=0.30

double_sim: how strict the double block matching is. Lower values allow more matches and stronger lock. Higher values allow fewer matches and more freedom.

single_sim: same idea, but for single blocks.

commit_margin: how obvious the best reference match has to be before the token can lock. Lower locks faster. Higher is cleaner but weaker.

commit_confirm: how many times the same match needs to repeat before it is treated as locked. 1 is aggressive. 2 is safer.

commit_anchor: how much pull remains after the token has locked. Higher keeps stronger identity pressure. Lower gives the model more freedom after the match is stable.

mask_threshold: only matters when subject_mask is connected. Higher shrinks the mask influence inward. Lower keeps more edge tokens.

subject_mask is still optional. Use it when the reference has more than one subject or when you only want the identity pulled from one area.

To be clear, the mask does not edit the reference latent. The model still sees the full reference. The mask only controls which reference tokens V3 is allowed to sample from for the identity pull.

For most people, use MIDUM_LOCK first

If the face or subject is still drifting, use HARD_LOCK.

If it starts copying too much or feels too stiff, use SOFT_LOCK.

If you already know what blocks you want to control, use custom.

The older Identity Feature Transfer and Advanced nodes are still included. V3 is the one I would start with now because it is more plug and play and the controls make more sense for actual use. And now I can officially say I am done with making things for flux 2 klein lol.

Please note:

Bypassing the node inside ComfyUI is not always a clean A/B test for this kind of node. This node works by attaching model patches to the MODEL object during execution. ComfyUI also caches model objects and graph results, so if the node was active in the same session, bypassing it can still leave you comparing against a cached or previously patched model path depending on how the workflow re-executes. For a proper test, restart ComfyUI, run the workflow once with the node fully disconnected or removed, then restart again and run with the node connected using the same seed and settings. Also, the node includes a small internal hook so it can access the needed single-block feature stage. That hook is installed for the Python session when the custom node loads, but it does nothing by itself unless the node's model patches are actually active. So the correct comparison is: - clean restart, no node connected - clean restart, node connected Not: - run with node - bypass node - run again in the same session That second test can give misleading identical or confusing results because of ComfyUI caching and session-level patching. Will be adding clear cache boolean soon though.

-fixed

Also one more reminder : Always pay attention to your mask; if connected and photo is not masked you will get 0 effect, so just a rule of thumb do not forget your mask connected unless you are using it. when you do not apply a mask on the photo DO NOT connect the mask or forget it as it will just keep getting 0 tokens.

u/Capitan01R- — 20 days ago

I am working on a better version of the previous identity transfer node, this version will be basically injecting the ref from multiple stages in the blocks that I target, it will do mid and post injection ( currently experimenting with those and seeing success) and that will lead to more stability, I am trying to corner the model yet make it as flexible as it can be. when done I will release the node with a plug and play preset 😄

context v1 : https://www.reddit.com/r/StableDiffusion/comments/1somo2r/coming_up_tomorrow_flux2klein_identity_transfer/

context advaned : https://www.reddit.com/r/StableDiffusion/comments/1su8c0a/flux2_klein_identity_feature_transfer_advanced/

u/Capitan01R- — 22 days ago

So I have been messing around today with the Flux2 VAE blocks, sorting which is which and trying to isolate somethings lol, and turns out that this 336 mb file hold more than you can imagine, it holds let's say 70% of preservation of the original ref latent; what I mean is I have been playing with the encoding part of the vae and I was able to preserve the character with least amount of prompting and no preservation nodes/loras at all, I am still messing with it and when done it will be just a VAE file that does it all, and the nodes I created can be a plus.. but the core thing in this is the VAE !

you can download it here : https://civitai.com/models/2581448?modelVersionId=2900131
please note that I am still working on optimizing it, not fully done yet but you can experiment with this version

reddit.com
u/Capitan01R- — 25 days ago
▲ 266 r/FluxAI+1 crossposts

Identity Feature Transfer now has an Advanced sibling, shipped as part of ComfyUI-Flux2Klein-Enhancer. Same core mechanism as the original, just way more control and an optional subject mask.

FLUX.2 Klein Identity Feature Transfer Advanced : Here

Workflow : here please use your own parameters as it's a taste based not set params :D

If you find my work helpful you can support me and buy me a coffee, I truly spend long hours thinking of solutions :)

----------------------------------------------------------------------------------------------------------------

Controls identity feature steering with per-band strength, a tunable similarity floor, a block schedule, and an optional spatial mask.

double_strength: per-block intensity for double blocks (pose, color, identity early). 0.15 to 0.20 is a safe start, raise to 0.4 to 0.6 for stronger guidance especially when the reference has multiple subjects.

single_strength: per-block intensity for single blocks (style, texture late). Same scale as double_strength.

double_start / double_end / single_start / single_end: which blocks are active. Lets you isolate identity (early blocks) or texture (late blocks) without touching the other.

block_schedule: flat keeps strength constant, ramp_down hits early blocks harder, ramp_up favors later blocks, peak_mid concentrates in the middle of the active range.

sim_floor: cosine similarity threshold gating which matches actually contribute. Low (around 0.05) gives a wide pull and a tight identity lock, ideal for subtle edits like outfit swaps where you want the character bit-perfect. High (around 0.4 to 0.6) makes the pull sparse and gives the model freedom to drift, ideal for broader edits.

mask_threshold: only matters when subject_mask is connected. 0.5 keeps boundary tokens, raise toward 1.0 to shrink the effective mask inward.

subject_mask (optional): paint the area of the reference you want the identity pulled from. When connected, the cosine pull samples ONLY from masked-in reference tokens.

mode and top_k_percent: same as the standard node.

------------------------------------------------------------------------------------------------------------------------------------------------------------

The headline upgrade is the mask. The original node pulled features from anywhere in the reference, which meant backgrounds and unwanted subjects could bleed into the generation. With the mask connected, the pull is restricted to whatever you painted, so only the character or area you actually care about contributes to the identity transfer.

To be clear, the mask does NOT modify the reference latent. The model still sees the full reference, attention works exactly the same, scene context is intact. The mask only narrows which reference tokens our identity pull samples from. So the model keeps full freedom over the rest of the generation while the identity transfer stays clean and surgical.

Combined with sim_floor you can dial the node from full identity lock all the way to loose guidance with maximum prompt freedom. With separate double and single block strengths you can target identity early or texture late without touching the other.

The standard Identity Feature Transfer is still in the pack. Use it for quick setups, reach for Advanced when you need the mask, the floor, or fine block control.

To Do next Identity Guidance Advanced...

u/Capitan01R- — 29 days ago