Krea 2 is a 12.9B single-stream flow-matching DiT trained from scratch, using a Qwen3-VL-4B text encoder and the Qwen-Image VAE. The transformer is vendored as a diffusers ModelMixin whose module tree mirrors the checkpoint, so weights load with no key conversion; the pipeline ports the reference encode, flow-matching denoise, and VAE decode. The text encoder is shared at runtime via the existing dedup registry, so Base and Turbo reuse one Qwen3-VL-4B copy.
Covers text-to-image, image-to-image, native LoRA, and the single-file UNET override. Also completes SD.Next's partial Qwen-Image VAE support (5D decode input and TAESD preview mapping) that K2 shares.
In get_mask() Edge mode, largest_size is set to 0 when there are no
contours, but the luminance loop is also entered when contours exist
whose largest has zero area (e.g. thin 1px / degenerate features whose
cv2.contourArea is 0). That path divides by largest_size and raises
ZeroDivisionError, crashing auto-masking. Guard the divide: when
largest_size is 0 the scaled luminance is 0, so the loop breaks on the
first iteration and yields an empty mask (the sensible no-region result).
Co-Authored-By: Claude <noreply@anthropic.com>
The DWPose (Legacy) "Pose Model" (Tiny/Medium/Large) radio wrote to
config['DWPose (Legacy)']['model'], but the rtmlib backend
(RtmlibPoseDetector.from_pretrained) only takes the mode string and
always loads RTMPose 'lightweight' - it never reads that key (the only
config[...]['model'] readers are the SegmentAnything branch). The
selector was a no-op left over from the removed mmpose DWPose processor
(see #4956).
Remove the radio, its dead 'model' config key (both the module-level and
delay_load_config dicts), and its update_settings slot; reindex the
remaining settings 18..27. The settings list stays 1:1 with the UI
controls (re-derived the append-order -> update_settings map to confirm).
No runtime behavior change. The alternative - keep the capability by
mapping Tiny/Medium/Large onto rtmlib's mode - is intentionally not taken
here since it would change which model loads.
Co-Authored-By: Claude <noreply@anthropic.com>
The 8d4ebcd5e rename updated the processor dropdown/config names but left
three settings-accordion titles on the pre-rename names, so a panel titled
e.g. "SegmentAnything" sits under the "SegmentAnything 1.0" dropdown entry.
Cosmetic only (Gradio accordion labels are display-only); aligns the titles:
- MediaPipe Face -> MediaPipe Face (Legacy)
- DWPose -> DWPose (Legacy)
- SegmentAnything -> SegmentAnything 1.0
Co-Authored-By: Claude <noreply@anthropic.com>
update_settings() and the XYZ [Control] Processor axis still used
pre-rename names ('MediaPipe Face', 'DWPose', 'SegmentAnything') that
no longer exist as config keys after 8d4ebcd5e.
- update_settings(): update stale keys to 'MediaPipe Face (Legacy)',
'DWPose (Legacy)', 'SegmentAnything 1.0' -- the KeyError at
'MediaPipe Face' (line 182) was silently dropping all settings after
position 13 on every panel change
- DWPose (Legacy) config: add missing 'model' key so update_settings
can persist the Pose Model radio value without crashing
- processor.processors list: remove stale 'DWPose' entry (already
present as 'DWPose (Legacy)') that caused XYZ [Control] Processor
to offer an unloadable option
Fixes#4953
Co-Authored-By: Claude <noreply@anthropic.com>
The "processors multiple fixes" rename split 'SegmentAnything' / 'SAM 2.1'
into 'SegmentAnything 1.0' / 'SegmentAnything 2.1' but left Processor.load()
matching the old name by substring:
elif 'SegmentAnything' in processor_id:
... config['SegmentAnything']['model'] ...
Post-rename this (a) raises KeyError because 'SegmentAnything' is no longer
a config key, so both SAM processors fail to load, and (b) wrongly routes
'SegmentAnything 2.1' (a Sam2Detector loaded via load_config) into the
SAM-v1 weight path instead of letting it fall through to the generic
load_config branch.
Match the v1 id exactly and key off config[processor_id], restoring the
pre-rename routing: v1.0 -> explicit SAM-v1 branch, v2.1 -> load_config.
Co-Authored-By: Claude <noreply@anthropic.com>
UpscalerSeedVR.load_model() rebinds the module-global
generation.generation_step (called by name inside generation_loop) to
the instance's model_step wrapper, keeping the previous value to call
back into. That global was never restored, so the second pass through
load_model() saved the wrapper itself as the "original", making
model_step() call itself -> RecursionError.
The second pass is reached on any model (re)load: with upscaler_unload
enabled (self.model reset to None after each run) every subsequent run
recurses, and switching SeedVR variants (self.model_loaded != model_name)
triggers it even without unload.
Stash the pristine generation_step on the module once and have the
wrapper call that, so repeated loads never wrap the wrapper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>