unsloth/studio/frontend/src/features
Daniel Han-Chen bec81b882d Fix/adjust diffusion: round 29 P1 + P2 batch for PR #5754
Five actionable findings from round 29 reviewer aggregate, plus an
origin/main merge that absorbs the chat_templates.py fix landed in
PR #5763. Skipped #4 / #5 (studio.txt + constraints.txt hub bump)
because CI evidence from round 26 contradicts that suggestion; the
real broken combo only happens via the --no-deps no-torch path
which is already bumped in no-torch-runtime.txt + pyproject.toml.

1. core/inference/diffusion.py: round 28 reordered
   _release_chat_backend_for_diffusion BEFORE
   _release_other_gpu_owners_for_diffusion to surface the helper /
   advisor busy check early, but that meant the chat unload inside
   _release_chat_backend_for_diffusion now fired before the
   training / export conflict check in the second helper. A direct
   backend caller (tests, scripts) or a route-precheck race with a
   newly-started training run would then unload the user's chat and
   then 409 with nothing loaded. Split the helper busy check into
   _raise_if_helper_advisor_busy_for_diffusion (cheap, no side
   effects), keep _release_chat_backend_for_diffusion as the
   actual chat unload with an opt-out flag, and reorder load_model
   to: (a) helper check, (b) training / export check + idle export
   shutdown, (c) chat unload. All raises now fire BEFORE any
   destructive unload.

2. Merge origin/main: absorbs af6504f9 (PR #5763
   chat_templates.py find() guards + the new
   tests/python/test_construct_chat_template_validation.py
   regression test). Removes the 101-line stale-rebase silent
   revert that round 29 reviewer 5 and 8 flagged.

3. frontend/src/features/images/images-page.tsx: supportsNegativePrompt
   now also honours customFamily when no model is loaded yet, so a
   Custom HF repo with family flux.2 / flux.2-klein correctly hides
   the negative prompt field instead of silently sending it.

4. routes/inference.py /images/generate: report the ACTUAL PNG
   width / height from PIL Image.size instead of echoing back the
   requested payload values. FLUX-family pipelines round to
   vae_scale_factor * 2, so a request for 520x520 lands as 512x512
   internally; metadata now matches the bytes on the wire.

Tests: 98 targeted (diffusion + cached_gguf + inference_validation)
and frontend npm run typecheck pass locally.
2026-05-25 14:45:15 +00:00
..
auth ci: unblock Studio Windows + Linux + Mac smoke (#5741) 2026-05-23 06:59:16 -07:00
chat Studio: render generated images inline for the Images pill (#5705) 2026-05-22 07:22:37 -07:00
data-recipes Fix Studio desktop tray installer and titlebar and bux fixes (#5179) 2026-04-30 08:40:39 -07:00
export studio/frontend: wire logout, singleflight refresh, shared 422 helper, current-password input (#5490) 2026-05-18 00:03:03 -07:00
images Fix/adjust diffusion: round 29 P1 + P2 batch for PR #5754 2026-05-25 14:45:15 +00:00
native-intents studio/frontend: make toast and inline error text selectable and copyable (#5506) 2026-05-18 03:47:21 -07:00
onboarding studio/frontend: fix onboarding CSP violations (#5658) 2026-05-22 05:02:19 -07:00
profile Studio: Polish spacing and profile input radius (#5222) 2026-05-04 00:38:19 +04:00
recipe-studio studio/frontend: make toast and inline error text selectable and copyable (#5506) 2026-05-18 03:47:21 -07:00
settings Studio: persist chat history in backend storage (#5272) 2026-05-22 06:18:05 -07:00
studio studio/frontend: make toast and inline error text selectable and copyable (#5506) 2026-05-18 03:47:21 -07:00
tour studio/frontend: fix onboarding CSP violations (#5658) 2026-05-22 05:02:19 -07:00
training studio/frontend: make toast and inline error text selectable and copyable (#5506) 2026-05-18 03:47:21 -07:00