You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(flux2): remove inert guidance UI, add Klein 4B Base variant, fix metadata recall (#8995)
* Fix(Flux2): Correct guidance_embed, add guidance support for Klein 9B Base, and fix metadata recall
Klein 4B and 9B (distilled) have guidance_embeds=False, while Klein 9B Base
(undistilled) has guidance_embeds=True. This commit:
- Sets guidance_embed=False for Klein 4B/9B and adds Klein9BBase with True
- Adds guidance parameter to Flux2DenoiseInvocation (used by Klein 9B Base)
- Passes real guidance value instead of hardcoded 1.0 in flux2/denoise.py
- Hides guidance slider for distilled Klein models, shows it for Klein 9B Base
- Shows Flux scheduler dropdown for all Flux2 Klein models
- Passes scheduler to Flux2 denoise node and saves it in metadata
- Adds KleinVAEModel and KleinQwen3EncoderModel to recall parameters panel
* test(flux2): cover Klein guidance gating, scheduler metadata, and recall dedupe
Add a mock-based harness for buildFLUXGraph that locks in the FLUX.2
orchestration: guidance is written to metadata and the flux2_denoise
node only for klein_9b_base, distilled variants (klein_9b, klein_4b)
omit it, the FLUX scheduler is persisted into both metadata and the
denoise node, and separately selected Klein VAE / Qwen3 encoder land
in metadata.
Add parsing tests for the metadata recall handlers: KleinVAEModel and
KleinQwen3EncoderModel only fire when the current main model is FLUX.2,
and the generic VAEModel handler now bails out for flux2 / z-image so
the metadata viewer no longer renders duplicate VAE rows next to the
dedicated Klein / Z-Image handlers.
* Chore pnpm fix
* Update version to 1.5.0 in flux2_denoise.py
* Update condition for rendering ParamFluxScheduler
* feat(flux2): add Klein4BBase variant for FLUX.2 Klein Base 4B models
Recognize FLUX.2-klein-base-4B on import via filename heuristic.
The variant shares Klein4B's architecture (Qwen3-4B encoder,
context_in_dim=7680) and reports guidance_embeds=False in its HF
config, consistent with Klein 9B Base. UI behavior stays identical
to distilled Klein4B until CFG support is wired up in a follow-up.
* Change Wrong Comment
* refactor(flux2): remove inert guidance UI/metadata for FLUX.2 Klein
All current FLUX.2 Klein variants (4B, 4B Base, 9B, 9B Base) report
guidance_embeds=false in their HF transformer config (or have zeroed
projection weights), so the guidance scalar has no effect on output.
The linear UI previously exposed a guidance slider for klein_9b_base
and wrote the value into metadata, which misled users into thinking
it was steering generation.
* Chore typegen
* fix test
* fix(flux2): skip Guidance metadata recall for legacy FLUX.2 images
The generic Guidance metadata handler unconditionally parsed
`metadata.guidance` and dispatched `setGuidance(value)` into the
shared params slice. For images generated before the Klein guidance
cleanup, this still fired — silently writing a stale guidance value
into the global state, which then leaked back into FLUX.1 on model
switch.
Gate the handler on `metadata.model.base`: reject parsing when the
image was generated with a FLUX.2 model. The handler is then skipped
for both display and recall on legacy FLUX.2 metadata, matching the
"silently ignored" contract stated in the PR.
- parsing.tsx: check metadata.model.base in Guidance.parse()
- parsing.test.tsx: three new cases covering FLUX.2 gating,
FLUX.1 pass-through, and back-compat for metadata without a
model field
---------
Co-authored-by: Jonathan <34005131+JPPhoto@users.noreply.github.com>
Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
0 commit comments