unsloth/studio
Daniel Han 1c110dc867 Studio: gate the base_model card tag on image loads, fix an unload/reload arbiter race, and don't crash the offload fallback on a partial dual-DiT hook set
- The companion base for a GGUF/single-file image load is resolved from the GGUF
  repo's base_model card tag when no base_repo is passed, and that value loads via
  from_pretrained. The explicit base_repo is already trust-gated, but the card tag is
  attacker-controlled metadata on any remote repo, so it now clears the same
  unsloth/allowlist/local trust bar; an untrusted tag is dropped in favour of the
  curated family default and never reaches from_pretrained. This closes a pickle
  deserialization vector on the normal GGUF load path (a user loading an attacker's
  GGUF repo whose card points base_model at a malicious pipeline), matching the
  trust discipline the ControlNet path already applies via evaluate_file_security.
  The allowlist already contains every legitimate variant base, so variant
  resolution for the supported unsloth GGUFs is unchanged.
- The images/unload route ran the slow VRAM-freeing unload on a thread and then
  released the DIFFUSION arbiter owner unconditionally. release() is owner-guarded
  and identity-less, so a concurrent /images/load that re-acquired DIFFUSION while
  the unload ran would have its ownership cleared by the trailing release, and a
  later chat load would then see no owner, skip eviction, and OOM against the newly
  resident pipeline. The route now releases only when nothing is resident again.
- _apply_group_offload placed the resident companions before attaching the
  transformer's group-offload hooks so a companion OOM returns with no hooks and the
  whole-module fallback stays valid, but the streamed loop itself installs hooks on
  each DiT in turn. On a dual-DiT pipeline where the second tower failed after the
  first got its hooks, it returned False with hooks already installed, and the
  caller's enable_model_cpu_offload fallback then crashed (diffusers rejects it on a
  partially group-offloaded pipe). It now propagates the real failure once any hook
  is installed, so the load fails with its actual cause instead of a misleading crash.

Adds regression tests: the untrusted card tag dropped to the family default (trusted
tag still honoured, explicit base still wins), unload keeping ownership when a model
is still resident (and releasing when not), and the partial dual-DiT hook set
propagating rather than falling through to a crashing whole-module offload.
2026-07-07 05:34:30 +00:00
..
backend Studio: gate the base_model card tag on image loads, fix an unload/reload arbiter race, and don't crash the offload fallback on a partial dual-DiT hook set 2026-07-07 05:34:30 +00:00
frontend Merge remote-tracking branch 'origin/main' into fold-integration 2026-07-07 01:46:07 +00:00
src-tauri Speed up Studio desktop startup (#6742) 2026-06-29 15:27:39 +02:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
install_llama_prebuilt.py Studio: stop handing CI/user secrets to downloaded llama.cpp binaries (#6696) 2026-06-27 05:21:05 -07:00
install_node_prebuilt.py Pin isolated Node.js installer to committed sha256 digests (#6625) 2026-06-24 05:47:58 -07:00
install_python_stack.py Guard Windows ROCm torchao override skip (#6837) 2026-07-03 19:24:29 +01:00
install_sd_cpp_prebuilt.py Studio: classify local video pipelines, harden video preflight, and gate custom-root sd.cpp removal on ownership 2026-07-07 03:15:07 +00:00
LICENSE.AGPL-3.0 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
node_prebuilt_pins.json Pin isolated Node.js installer to committed sha256 digests (#6625) 2026-06-24 05:47:58 -07:00
package-lock.json ci: advisory lockfile supply-chain audit (no install-script changes) (#5604) 2026-05-19 05:56:56 -07:00
package.json ci: advisory lockfile supply-chain audit (no install-script changes) (#5604) 2026-05-19 05:56:56 -07:00
setup.bat Final cleanup 2026-03-12 18:28:04 +00:00
setup.ps1 [Studio] Add --with-llama-cpp-dir installer flag to reuse a local llama.cpp (#6472) 2026-07-02 22:11:20 +01:00
setup.sh [Studio] Add --with-llama-cpp-dir installer flag to reuse a local llama.cpp (#6472) 2026-07-02 22:11:20 +01:00
Unsloth_Studio_Colab.ipynb Studio Colab: opt-in shareable Cloudflare tunnel link (#6684) 2026-06-26 00:56:23 -07:00