Repository navigation
Conversation
…n models (unslothai#8618) - Add UI selector in Image and Video Generation Advanced Options panels for family_override. - Thread family_override through load and download planning requests. - Add delimiter flexibility and aliases in diffusion_families.py and video_families.py. - Add backend unit tests for family overrides and delimiter variations.
c255d27 to
613fdd5
Compare
|
@karan68 this screenshot is not from Unsloth Desktop... have you manually verified and tested the fix? |
|
@mahiatlinux Yes, here is a screenshot from the running Unsloth Studio interface showing the new Family override control under Advanced Options: Review Feedback Addressed & Verified:
|
2138516 to
d0062aa
Compare
d0062aa to
cfa6de2
Compare
…ipe edits across load
|
Confirmed there is no way to set family_override from the images or video tabs today, only through the API layer in studio/frontend/src/features/images/api.ts, so the selector is worth having. The direction is right but the same _token_regex helper is copied into both diffusion_families.py and video_families.py and the bare "klein" alias widens auto-detection beyond the ask, so could you factor the helper into one place and keep the matching change minimal? |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…edback # Conflicts: # studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d8f2c1034
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| supportsStandaloneCheckpoint && | ||
| (recoverableDiffusionGguf || inertSafetensors) |
There was a problem hiding this comment.
Admit opaque pipeline directories for family overrides
When a local full Diffusers pipeline has an opaque directory name and its metadata does not map to a known family, classification leaves it with task == null, model_format == "unknown", and canChat == false. The shared inventory only preserves the inert-safetensors signature, and this predicate likewise accepts only GGUF or safetensors; moreover, supportsStandaloneCheckpoint explicitly rejects MiniMax-H3. Consequently, selecting the H3 override can never expose an unrecognized local H3 pipeline, even though H3 is pipeline-only and family_override is the only way to classify such a custom fine-tune. Preserve and admit taskless Diffusers pipeline-directory rows when an explicit compatible family is selected.
Useful? React with 👍 / 👎.
| _DIFFUSION_COMPANION_WEIGHT_STEMS = frozenset( | ||
| {"ae", "vae", "clip_l", "clip_g", "t5xxl", "learned_embeds", "embeddings"} | ||
| ) |
There was a problem hiding this comment.
Exclude registered text encoders from checkpoint discovery
The new bare-safetensors classifier does not recognize several text-encoder filenames that this repository itself registers as diffusion companions, including qwen_3_4b.safetensors, qwen_3_8b.safetensors, and mistral_3_small_flux2_bf16.safetensors in diffusion_families.py. If one of these files is placed directly under ./models, an LM Studio root, or a custom scan folder, it is classified as an inert standalone checkpoint and becomes selectable as soon as a family override is chosen; selecting it then sends an encoder-only payload through the diffusion single_file loader and fails. Add the known companion basenames (or derive them from the family registry) to this exclusion.
Useful? React with 👍 / 👎.
| return _is_transformers_safetensors_weight_name(path.name) | ||
|
|
||
|
|
||
| _SAFETENSORS_SHARD_SUFFIX = re.compile(r"-\d+-of-\d+\.safetensors$", re.IGNORECASE) |
There was a problem hiding this comment.
Recognize dtype-qualified safetensors shards
This suffix only rejects shards whose count is immediately followed by .safetensors, but the repository documents real Diffusers shard names such as diffusion_pytorch_model-00001-of-00002.bf16.safetensors in hub/utils/inventory_scan.py. When dtype-qualified shards are loose files in ./models, LM Studio, or a custom scan root, each file is classified independently as a complete inert checkpoint, exposed by a family override, and then fails when loaded alone. Match the optional variant segment between the shard count and .safetensors so incomplete variant shards cannot be offered as standalone models.
Useful? React with 👍 / 👎.
|
Superseded by #10150, which carries forward the original feature from @karan68 and credits Karan as a co-author on the replacement commit. The new branch starts from current main and replaces the review-churn heuristics with an explicit structural artifact contract, while preserving the family-override product direction. Closing this PR so review and CI converge on one branch. Thank you @karan68 for originating the fix. |
Adds a registry-backed Family control to Images and Video, pins family_override through download planning, staging, loading, status and Reapply, and admits a task-less cached row only when a non-Auto family is chosen and the folder is a complete Diffusers pipeline root. Fixes #8618. Supersedes #8622. Co-authored-by: karan yadav <[email protected]>

Fixes #8618
Problem
When loading fine-tunes, merges, or custom derivative checkpoints for diffusion image or video models (e.g.
user/FLUX.2_klein_9B,user/flux2_klein,user/klein-image-gen, or custom community LoRA/GGUF repacks), the backend raises a refusal because the repo id does not match canonical family substring heuristics:_ValueError: '{model_name}' is not a supported diffusion image model. Supported families: flux.1, flux.2-klein, flux.2-dev, ... If this is a variant of one of them, pass family_override with that family name.
While the backend load and download-plan endpoints already accepted a
family_overrideparameter, there was no way for users to set this override in the Studio UI. Additionally, delimiter variations in repo names (e.g., underscores_vs hyphens-or dots.) caused heuristic auto-detection to fail on common names likeFLUX.2_klein_9B.Changes
Frontend (
images-page.tsx&video-page.tsx):"Auto (detect)").FLUX.1,FLUX.2 Klein,FLUX.2 Dev,FLUX.1 Kontext,Qwen-Image,Qwen-Image-Edit,Z-Image,Krea 2,Lumina 2,HunyuanImage 2.1,HiDream-I1,Ideogram 4,SDXL.MiniMax-H3,LTX-2,Wan2.2-TI2V-5B,Wan2.2-T2V-A14B,HunyuanVideo-1.5.family_overridethroughLoadAdvanced/VideoLoadAdvanced,currentLoadAdvanced,loadDiffusionModel/loadVideoModel, and the download staging preflight (getDiffusionDownloadPlan/getVideoDownloadPlan).LoadedBuildSummaryandformatResolvedValue.Backend Delimiter Flexibility & Aliases (
diffusion_families.py&video_families.py):_token_in_needlewith_token_regexto match delimiter variations (_,.,-,/,\), allowing repo names such asFLUX.2_klein_9B,flux2_klein, andflux-klein-v1to auto-detect without requiring manual overrides."flux-klein","klein").video_families.py.family_overrideinbuild_resolved_recordfor runtime provenance.Tests (
test_diffusion_backend.py):family_overrideresolution.test_detect_family_delimiter_flexibilitycovering underscores, hyphens, and shorthand naming variants across families.Verification
user/FLUX.2_klein_9B->flux.2-kleinuser/flux2_klein->flux.2-kleinuser/flux-klein-v1->flux.2-kleinuser/klein-4b-lora->flux.2-kleinuser/FLUX.2_dev->flux.2-devuser/flux-2-dev->flux.2-devuser/qwen_image_lora->qwen-imageuser/z_image_turbo->z-imageuser/wan2_2_ti2v_5b->wan2.2-ti2v-5bfamily_overrideon unrecognized custom repo names for all supported image and video families.build_resolved_recordprovenance andformatResolvedValuetitle formatting.test_diffusion_backend.py(all passed).