Spaces:
Running on Zero
Running on Zero
Commit History
30 days ago
-
fix: classify new catalog LoRAs as kohya, sniff format from keys Running
`nsfw_h3_unlocked` (Kutches/minmax) and `nsfw_mystic_xxx_v4.0` (B4100/mystic-h3) ship kohya keys (lora_unet_*/lora_down/lora_up/alpha) but were cataloged as ComfyUI, so `_convert_comfyui_h3_lora` indexed past the end of a 2-part key and the request died with IndexError. - config.py: `format: "kohya"` on both entries; fix the dangling LORA_CONFLICT_GROUPS reference to the renamed mystic entry; refresh the catalog classification comment. - formats.py: new `_detect_lora_format` + `_convert_lora` entry point — the sniffed format wins, the declared one is a tiebreak, and remaining converters are tried if one maps nothing, so a mislabeled file loads instead of crashing. - formats.py: `_convert_comfyui_h3_lora` skips unrecognized key shapes instead of indexing them, requires a numeric block index, and normalizes the PEFT `.default` infix (`nsfw_framerush` was converting to zero modules, i.e. a silent no-op). - fetch.py: all four loaders go through `_convert_lora` (was triplicated…bc09615 -
feat: update NSFW LoRA configurations with new models and enhancements
5e4bf9a
-
Merge upstream MiniMax H3 updates and preserve beta5 checkpoint
b0eb306 -
Use merged-Turbo beta5 bf16 checkpoint with seven-step defaults
Verified signature86770a3 -
Disable incompatible Turbo LoRA for beta5 and validate merge shapes
Verified signature27d0566 -
Load pinned non-Turbo 10Eros-Max beta5 bf16 transformer
Verified signature820b80a
-
fix: allow CivitAI R2 CDN redirects; strip Bearer on CDN hop
CivitAI (civitai.red/com) 307-redirects api/download/models/{id} to civitai-delivery-worker-prod.*.r2.cloudflarestorage.com. The SSRF allowlist only had api hosts, so downloads failed with 'non-allowlisted host'. - Allow civitai-*.r2.cloudflarestorage.com (not arbitrary R2 buckets) - Drop Authorization when following signed CDN URLs (Bearer caused HTTP 400) - Same treatment in civarchive mirror path444989a -
feat: h3-{task_id}.mp4 + community dropdown fixes
- Output video basename is h3-<task_id>.mp4 (Gradio download shows task id) - Rewrite _community_lora_choices: no nested loops; skip cache only on exact basename - Community dropdown interactive=True; use .change (not broken .select+SelectData) - Page load/focus return full interactive Dropdown Addresses PR review: select handler, repo-prefix cache filter, rebase on main.4ae1908
-
revert: load_models at import time (model loads during BUILDING, UI shows ready)
Verified signatureReverts the previous commit. The user wants the Space to stay in BUILDING until load_models() finishes the ~77 GB download, so the UI shows up with everything ready. The previous background-thread approach bypassed this and the user explicitly preferred the synchronous pattern.826b8b9 -
fix: load_models in background thread so Space leaves BUILDING immediately
Verified signaturePreviously: load_models() was called at module import time, synchronously downloading ~77 GB. Hugging Face keeps the Space in RUNNING_BUILDING until the module import returns, so the Space never transitioned to RUNNING until the download finished (and never did if it errored). Now: demo = build_ui() runs first (instant), then load_models() kicks off in a daemon thread. The Space leaves BUILDING as soon as the module import completes. The status banner shows 'Loading ...' via demo.load(_on_page_load, ...) until the background load finishes, at which point the next page refresh reads 'Ready'. Premature Generate clicks still fail cleanly via the existing `_state.PIPE is None` guard in _generate_impl.144899b -
fix: Gradio 6 postprocess — video never shown after successful generate
generate OK then crashed in postprocess_data: InvalidComponentError: Accordion is not a valid output component - Remove upsampled Accordion from run.click outputs - Return gr.update for upsampled textbox + lora label - Return gr.DownloadButton(value=path) for the download control - Keep video path as first output so gr.Video displays the file9112a22 -
fix: NSFW LoRA applied label + load verification
NSFW merges were working (logs: 'LoRA nsfw_* merged') but UI showed applied=[] because the GPU worker cannot update main-process task.applied_loras. Restore label from nsfw_keys/custom/turbo; log effective keys/scales; warn on skipped apply; error if ensure left an empty module list.9b00bca
-
fix: allow catalog NSFW LoRAs up to 1.5 GB
Photorealistic Image Generator (596 MB) exceeded the 512 MB custom-LoRA cap. Catalog entries now use max_bytes=1.5GB; user custom LoRAs stay at 512MB.03de483 -
fix: import NSFW_LORA_CONFIGS in pipeline for @spaces.GPU worker
NameError inside _generate: NSFW_LORA_CONFIGS was only imported inside _generate_impl, so the ZeroGPU worker process did not see the name.20171fd -
fix: encode_video frames API + apply nsfw scales
- encode_video(frames, ...) matching original (frames[None] TypeError on list) - detach tensor→numpy if needed before mux - _generate uses nsfw_scales when merging LoRAs5bff36f -
fix: read PIPE/LOAD_ERROR from state module at runtime
from state import PIPE bound the name at import time to None; load_models rebound state.PIPE but pipeline/request/fetch still saw the old None. All rebindable globals now go through import state as _state.287aa00 -
fix: generate arg mismatch; load models before UI
- _generate_impl accepts nsfw_lora_scales/active_custom_loras/custom_lora_scales - Safe dataframe row parsing (no numpy truth-value errors) - Startup order: load_models() then build_ui() then launch so UI starts ready414b13a -
fix: launch Gradio before load_models so Space leaves BUILDING
The ~77GB checkpoint download ran before demo.launch(), so HF never got a healthcheck response and stayed on Building. Load models in a background thread after the module-level demo is constructed; show a status banner.505a4ff -
fix: import _lora_cache_path from lora.fetch; dropdown empty values
- load_models probed lora.cache which never exported _lora_cache_path (ImportError) - community dropdown value=None for single-select; allow_custom_value on empty lists26c0722 -
fix: turbo LoRA size limit + isolate load failure; dropdown None
- System turbo weights (~851 MB) use max_bytes=2GB override (user LoRA cap stays 512MB) - Turbo load failure no longer aborts entire load_models / PIPE setup - Community dropdown value=[] instead of None (Gradio choice error) - column_count replaces deprecated col_count - Turbo checkbox always visible; state globals written correctly60cb470 -
refactor: split app.py into focused modules (#5)
- refactor: split app.py into focused modules (4e0803b56388a42861ecb344b9e6c3b94cae2a77) - feat(ui): removable community LoRAs + per-LoRA strength (3322d355df9b2874d065a3e56d69914f9b97f612)64db20c
-
Revert to e054b84d: video retention 25→200 + NSFW enhancer checkboxes
Verified signatureReverted the progress-message and conditioner-timeout changes from c4494471. This restores the simpler progress() calls and the original predict()-based encode_remote while keeping the _MAX_OUTPUTS=200 bump and the nsfw_aio / astro_nsfw checkbox UI.3fa59da -
Progress messages + robust conditioner retries (no more stuck 'processing')
Verified signature- Added granular progress bar messages at every pipeline stage: • 'Loading NSFW LoRA (1/3): Astro NSFW ...' during LoRA loading • 'Sending prompt to conditioner ...' before conditioning • 'Denoising: step 0/25 — 62s estimated ...' before GPU work • 'Encoding video to MP4 (243 frames)' during mux Users now see exactly what's happening instead of blank 'processing'. - Replaced blocking predict() with submit()+job.result(timeout=180s) in encode_remote. The conditioner call can no longer hang forever. - Increased conditioner retries from 1 to 3 with exponential backoff (2s, 4s, 6s) and clear user-facing error messages explaining the failure (quota, restart, network) instead of an opaque traceback.c449447
-
Video retention 25→200 + NSFW enhancer checkboxes
Verified signature- Increased output video rotation limit from 25 to 200 so older generations survive longer in /tmp before cleanup. - Replaced auto-loading of nsfw_aio whenever any NSFW LoRA is selected with two explicit checkboxes (mutually exclusive): • HMNSFW AIO V2.5 (motion adapter) • Astro NSFW (quality enhancer) Users now choose which enhancer to pair with their selected LoRAs, or none.e054b84 -
URGENT: fix _detect_wrong_arch false-positive on H3 turbo LoRA
Verified signatureH3's transformer is called 'diffusion_model' so kohya H3 LoRAs legitimately contain that in their keys (lora_unet_diffusion_model.blocks.N...). Removed the diffusion_model check which was incorrectly rejecting the official InstantX turbo LoRA, bricking the entire Space. Removed the catch-all 'different model architecture' fallback too — empty string means no issue detected.6e7091e -
fix: architecture gate in _fetch_lora_file — reject incompatible LoRAs before caching
Verified signatureThree-layer defense: 1. _fetch_lora_file on cache hit: peek header, evict incompatible cached files 2. _fetch_lora_file on fresh download: peek header before bucket copy 3. _load_lora_from_cache: peek header, delete incompatible files from cache All three show 'Looks like a FLUX LoRA' style message and remove the file from both HF cache and bucket cache. Incompatible LoRAs are no longer stored in /data/loras.bf2fcd5 -
fix: detect wrong LoRA architecture (FLUX/SDXL/SD1.5) and show clear error
Verified signature_add detect_wrong_arch() that inspects raw keys for known non-H3 architectures (double_blocks=FLUX, input_blocks=SD1.5/SDXL). Both _ensure_custom_lora_loaded and _load_lora_from_cache now show 'Looks like a FLUX LoRA — needs MiniMax-H3 retraining' instead of the cryptic 'converted to no usable modules'.400c7a8 -
fix: error handlers in _download_custom_lora now return 2 values (markdown + dropdown)
Verified signatureAll error paths (cache and non-cache) were returning only 1 value but the function has 2 output components [markdown, dropdown]. Added gr.update() no-op for the dropdown on every error path.f9ea94d -
fix: add interactive=True to gr.Dropdown return — was disabling the search box
Verified signaturedemo.load() and focus() return gr.Dropdown(choices=...) which replaces the component. Without interactive=True Gradio treats it as output-only (disabled, stop-sign cursor). Fixed.30799f8 -
fix: robust community dropdown — os.listdir, gr.Dropdown return, focus refresh, debug logging
Verified signature- Use os.listdir() instead of glob.glob() for HF Bucket FUSE mount compat - Return gr.Dropdown(choices=...) instead of gr.update(choices=...) — proper Gradio 6 - demo.load() + focus() dual refresh — covers startup and user interaction - Added debug logging: counts, directory check, error handling per source - Wrapped scan in try/except so errors never break the UI9a1a406 -
fix: populate community dropdown via demo.load() after bucket mounts
Verified signature_community_lora_choices() was called at import time (before load_models()) so the choices list was always empty. Now: - demo.load() callback re-populates the dropdown on page connect - Header markdown always visible - Dropdown always created (not conditional on empty build-time list)60eb7f5 -
fix: cached LoRAs fully wired — dropdown discovers /data/loras/*.safetensors, loads direct from disk
Verified signature- _community_lora_choices() scans bucket cache dir for .safetensors not in registry, shows them with cache: prefix - _load_lora_from_cache() loads safetensors by path, detects format (ComfyUI/kohya/LoKR), converts, stores in _CUSTOM_LoRA - _download_custom_lora() detects cache: prefix, skips download - _generate_impl() handles cache: keys for the generate pipeline - ~100 previously-invisible cached LoRAs now searchable in dropdown0d1dbfc -
fix: community dropdown scans bucket cache for .safetensors not yet in registry
Verified signature_community_lora_choices() now also globs /data/loras/*.safetensors and adds any cached files that aren't in the JSON registry yet, so the search dropdown finds LoRAs from previous sessions.62299e2
-
feat: auto-register custom LoRAs in community registry on download
Verified signature- _download_custom_lora now auto-adds to /data/community_loras.json on success - Description/tags fields moved inline with the Download & Verify section - Separate Submit to Community accordion removed — download IS the community contribution - community_lora_dropdown refreshed after each download3fdd00e -
fix: always create community_lora_dropdown (NoneType _id crash on empty registry)
Verified signature665c3f5 -
feat: per-request resource lifecycle, VAE CPU offload, LoRA LRU eviction
Verified signature7d06402
-
Remove concurrency_limit — no request queue, memory cleanup retained
Verified signature995d272 -
Aggressive memory optimizations: worker-side state release + CUDA cache return after every request, main-process frames/audio cleanup after mux, encode_remote temp file removal, startup pack cleanup, and concurrency_limit=1 on generate
Verified signature1acc2f3
-
LoRA lifecycle hardening + conditioner retry + output rotation
Verified signature731d4fc
-
Fix kohya LoRA converter for hybrid ComfyUI-prefix + kohya-suffix format (missionary LoRA IndexError crash)
Verified signature40ddddb -
Add OOM diagnostics: memory phase logs (_log_mem), in-generation sampler, bucket debug dumps to /data/debug (startup + oom with torch memory summary)
Verified signaturec1cbf61
-
Add extensive debug logging (_log) + bucket-backed LoRA cache (_fetch_lora_file at /data/loras); generate wrapper logs requests/failures
Verified signaturec977a06
-
Remove _TURBO_MERGE_BONUS from get_duration: the turbo merge is instant, the 120s bonus inflated the duration reservation
Verified signatureabc01d9 -
Remove _LORA_MERGE_BONUS from get_duration: NSFW/custom LoRA merges are instant, the 60s/LoRA bonus inflated the duration reservation
Verified signaturef45e1e9 -
Fix 5 oracle findings: parse tree/blob repo-page and spaces/-prefixed URLs, budget NSFW/custom LoRA merge time in get_duration, show LoRA label for custom-only runs, correct kohya alpha/rank scaling
Verified signature3cd4c9d
-
Rework custom LoRA to a single URL box + Download & Verify button: paste an HF repo link or direct .safetensors link, download/verify/load on button press, apply on Generate
Verified signaturecded1e5 -
Add Custom LoRAs section: load user-supplied MiniMax-H3 LoRAs from any public HF repo (ComfyUI/kohya auto-detected), per-row scale + optional trigger, AIO auto-loads, applied/removed around the denoise
Verified signaturef7f09ad -
Remove 'Suggest LoRAs from prompt' button and its keyword map; keep conflict checker
Verified signaturebbbbc0b -
Fix startup crash: gr.Button does not accept info kwarg in gradio 6.20
Verified signatureeb78354 -
Add 'Suggest LoRAs from prompt' button (keyword-matched top 5), conflict warnings in the LoRA description box, remove gr.Examples
Verified signature220454b