unsloth/scripts
Daniel Han ffa8a56391 Merge image-generation bug fixes (#6872)
Fold PR #6872's image-generation fixes into the branch, deduped against the
round-12 dataset-upload and gallery integrity work already on image-generation.

Fixes carried forward from #6872:
- fp8 single-file transformer memory estimate: an fp8 checkpoint loads with no
  quantization_config and diffusers upcasts it to bf16 (~2x resident), so budget
  it accordingly in _plan_memory and estimate_safetensors_dense_mib.
- dense-quant OOM-evict preflight: when the GGUF fits resident but the dense bf16
  transformer this path materializes does not, skip the fast path up front rather
  than evict the current pipeline and OOM in finalization. Combined with the
  existing offload->resident candidate re-plan so both the family-table estimate
  and the on-disk shard measurement gate engagement (unified on the
  transformer_resident_override_mib plan override).
- ControlNet: evict the previous module and its from_pipe wrapper before loading a
  new one so swapping ControlNets within a base-model load cannot accumulate to OOM.
- ControlNet union_control_mode: raise on an unknown control type instead of
  silently defaulting to canny.
- edit-family mask rejection: raise instead of silently dropping a mask on an
  image-editing model that has no inpaint pipeline.
- companion cache: walk the snapshot dir and exclude transformer/ so the
  dense-quant prefetch's cached shards do not inflate the companion total and
  wrongly force offload.
- training: drop piecewise_constant from the LR scheduler enum and force bf16 for
  fp16-incompatible families.
- dataset upload: batch-atomic staging with the same-stem duplicate guard.
- images page: guard negative-prompt restore on guidance>0, clear stale ControlNet
  selection on restore, and revert an optimistic quant label when a pipeline load
  never starts.
- uninstall (sh + ps1): keep the owner-marker guard on sd.cpp removal.

Conflicts resolved in favour of image-generation's evolved memory system,
loadSpecFor catalog, and stop-and-save (lora_path) run detection; #6872's fp8 and
dense-preflight fixes carried forward on top. All affected backend tests pass
(test_diffusion_backend, test_diffusion_training, test_diffusion_lora_trainer,
test_video_gallery, test_diffusion_controlnet).
2026-07-07 16:14:06 +00:00
..
data CI: scope GITHUB_TOKEN permissions, add MLX CI, unblock ~60 skipped tests (#5312) 2026-05-11 03:19:13 -07:00
build_prequant_checkpoint.py Studio: diffusion UX polish and stronger auto policies (images + video) (#6885) 2026-07-06 17:48:39 -07:00
check_frontend_dep_removal.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
check_new_install_scripts.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
compare_engines.py Studio diffusion (Phase 7): accuracy-preserving speed pass (2.2x via GGUF compile) (#6690) 2026-07-01 15:31:50 -03:00
compile_probe.py Studio diffusion (Phase 7): accuracy-preserving speed pass (2.2x via GGUF compile) (#6690) 2026-07-01 15:31:50 -03:00
diffusion_bench.py Studio diffusion (Phase 8): opt-in fast transformer (torchao int8/fp8/fp4 on a dense source) (#6694) 2026-07-01 15:36:43 -03:00
diffusion_quality.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-07-02 03:30:16 +00:00
enforce_kwargs_spacing.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
fbcache_flux_probe.py Studio diffusion (Phase 12): First-Block-Cache step caching for many-step DiT (#6703) 2026-07-01 15:40:52 -03:00
fp8_overflow_check.py Studio diffusion (Phase 8): opt-in fast transformer (torchao int8/fp8/fp4 on a dense source) (#6694) 2026-07-01 15:36:43 -03:00
install_gemma4_mlx.sh Update Install Scripts (#5968) 2026-06-03 05:39:42 -07:00
install_qwen3_6_mlx.sh Update Install Scripts (#5968) 2026-06-03 05:39:42 -07:00
install_rocm_wsl_strixhalo.sh Windows/WSL installer: fix winget msstore cert failure, amd-smi DiskPart prompt, and enable AMD GPU (Strix Halo gfx1151) (#5940) 2026-06-10 04:24:49 -07:00
int8_linear_probe.py Studio diffusion (Phase 14): fix int8 dense quant on Flux / Qwen (skip M=1 modulation linears) (#6716) 2026-07-01 15:41:49 -03:00
leverage_probe.py Studio diffusion (Phase 7): accuracy-preserving speed pass (2.2x via GGUF compile) (#6690) 2026-07-01 15:31:50 -03:00
lint_workflow_triggers.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
lockfile_supply_chain_audit.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
notebook_to_python.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
notebook_validator.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
nvfp4_probe.py Studio diffusion (Phase 8): opt-in fast transformer (torchao int8/fp8/fp4 on a dense source) (#6694) 2026-07-01 15:36:43 -03:00
nvfp4_t211_probe.py Fix diffusion training validation, dataset upload atomicity, and LoRA error mapping 2026-07-04 03:17:12 -03:00
perf_levers_probe.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-07-02 03:30:16 +00:00
perf_verify.py Studio diffusion (Phase 7): accuracy-preserving speed pass (2.2x via GGUF compile) (#6690) 2026-07-01 15:31:50 -03:00
prequant_probe.py Studio diffusion (Phase 9): pre-quantized transformer loading (#6700) 2026-07-01 15:37:53 -03:00
quant_probe.py Studio diffusion (Phase 8): opt-in fast transformer (torchao int8/fp8/fp4 on a dense source) (#6694) 2026-07-01 15:36:43 -03:00
run_ruff_format.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
scan_npm_packages.py scan_packages: key baseline on matched-code hash so payloads in baselined files are not auto-suppressed (#6552) 2026-07-01 04:03:59 -07:00
scan_npm_packages_baseline.json scan_packages: key baseline on matched-code hash so payloads in baselined files are not auto-suppressed (#6552) 2026-07-01 04:03:59 -07:00
scan_packages.py CI: baseline the fastapi/gguf scan findings for the studio dependency set 2026-07-02 02:04:28 +00:00
scan_packages_baseline.json Merge remote-tracking branch 'origin/main' into fold-integration 2026-07-07 05:52:16 +00:00
sd_cpp_smoke.py Studio diffusion (Phase 6): img2img / inpaint / edit / LoRA / upscale on the native engine (#6680) 2026-07-01 15:18:38 -03:00
sparse_accum_probe.py Fix diffusion training validation, dataset upload atomicity, and LoRA error mapping 2026-07-04 03:17:12 -03:00
stamp_studio_release.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
sync_allow_scripts_pins.py Studio: auto-sync allowScripts pins after dependency bumps (#6136) 2026-06-10 02:35:37 -07:00
uninstall.ps1 Merge image-generation bug fixes (#6872) 2026-07-07 16:14:06 +00:00
uninstall.sh Keep an unowned default-mode sd.cpp checkout on uninstall 2026-07-07 10:22:40 +00:00
verify_comment_only_diff.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
verify_import_hoist.py studio: tool calling for DeepSeek (R1/V3/V3.1), GLM 4.x, Kimi K2 on safetensors + MLX (#5624) 2026-07-06 15:40:46 -07:00
verify_prequant_backend.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-07-02 03:30:16 +00:00
video_quality.py Fail video quality gate on candidate frame-count mismatch 2026-07-05 07:46:42 +00:00