Spaces:
Running on Zero
Running on Zero
Commit History
-
Fix turn_into_video: normalize Wan return shape + serve video locally
Backend: Wan's /generate_video returns (video, seed) where video may be a dict ({video: path}) or a bare string depending on gradio_client version — the old video_path['video'] assumed a dict and crashed with 'string indices must be integers'. Normalize to a single path robustly. Then copy the file into our own outputs/ dir (it lives in the Wan Space's temp dir, not served by this app) and return FileData pointing at the local copy, served via the /outputs mount. Frontend: resolve video URL with absURL(fd.url || fd.path), log raw result, and call video.load() after setting src. Handle both FileData and string shapes. Co-Authored-By: GLM 5.2 <noreply@zai.org>f074c20 -
Mount /outputs statically so generated PNGs are served (404 fix)
gradio.Server (unlike gr.Blocks) does not auto-serve the working directory, so /outputs/<file>.png returned 404 -> broken image in the browser. Mount the outputs/ dir as a FastAPI StaticFiles route at /outputs. The directory already exists at module load (created in Config), satisfying StaticFiles' requirement. Co-Authored-By: GLM 5.2 <noreply@zai.org>0d0014f -
Serve outputs/ (not tempfiles) + harden frontend URL extraction & logging
Backend: revert to saving outputs to outputs/ and returning FileData(path=...). On ZeroGPU the @spaces.GPU worker can be torn down right after the call, deleting tempfiles before the browser fetches their URL -> broken image. outputs/ is persistent in the app dir and Gradio serves it via file protocol. Frontend: log the raw predict() result and parsed results to console so we can see the actual data shape / URL. Normalize result extraction (handle both [images, seed] and object shapes). Add absURL() to resolve relative Gradio file paths against the origin, and onerror handlers on the preview image to surface load failures instead of a silent broken icon. Co-Authored-By: GLM 5.2 <noreply@zai.org>b27b052 -
Fix endpoint output decl + url=None: add return type hints, serve via temp FileData
@app.api infers the number/type of output components from the return-type hint. With no hint it declared 0 outputs, dropped the return, and the FileData was never serialized through a file component — so it came back with url=None and the frontend saw 'No images returned'. Add return hints -> tuple[list[FileData], int] (infer) -> FileData (turn_into_video) so proper output components are built and the FileData gets a served URL. Also: Gradio doesn't auto-serve arbitrary dirs in Server mode, so write the FileData-backed copy to a tempfile (which it serves reliably) while still mirroring to outputs/ for on-disk persistence. And drop the now-stale progress(...) calls from turn_into_video (progress param was removed earlier; calling it would NameError at runtime). Co-Authored-By: GLM 5.2 <noreply@zai.org>17bf644 -
Fix transformer pos_embed crash and frontend submit().on() error
Backend: load base Qwen-Image-Edit-2511 transformer weights into our custom QwenImageTransformer2DModel class (its pos_embed/QwenEmbedRope has the (img_shapes, txt_seq_lens, device) signature our pipeline calls; diffusers' built-in class has a different arg order, causing 'got multiple values for argument device'). Same public repo, no 401; FA3 still disabled. Frontend: CDN client's submit().on() isn't a function in this build — switch to the documented predict() API (still routes through the queue). Live step fraction unavailable, so progress shows an indeterminate bar + 'Generating…'. Removed now-unused onStatus handler. Co-Authored-By: GLM 5.2 <noreply@zai.org>e6b651d -
Drop gr.Progress param from @app .api endpoints
gradio.Server @app.api treats every typed param as a client-supplied input component; gr.Progress isn't special-cased as an injected sentinel in that path, so the default-instance init crashed app.launch(). Frontend still gets live progress via the queue's own status events (stage/queue/eta). Co-Authored-By: GLM 5.2 <noreply@zai.org>a89b28a -
Add type hint to progress params for gradio.Server api() validator
Gradio 6.20's @app.api() requires type hints on every parameter; progress was the only un-annotated one in both endpoints, blocking app.launch(). Co-Authored-By: GLM 5.2 <noreply@zai.org>291a410 -
Temporarily fall back to base Qwen-Image-Edit-2511 (v18 transformer repo 401)
The Sneak-Moose/Qwen-Rapid-AIO-v18-NSFW-diffusers repo is currently 401/not-found, blocking startup. Original transformer load + FA3 setup kept as comments (for a later PR to the original author); base model loads its own transformer in the meantime so the app can run for testing. Co-Authored-By: GLM 5.2 <noreply@zai.org>068e315 -
Switch to gradio.Server with Photoshop-style studio UI
Replace gr.Blocks UI with gradio.Server (FastAPI + Gradio API engine). infer and turn_into_video are now @app.api endpoints (queued, concurrency- controlled, gradio_client-compatible); index.html is served via @app.get('/') as a custom vanilla HTML/CSS/JS frontend that talks through the Gradio JS client so requests flow through the queue with live progress and queue position. New studio UI: menubar, left toolbar, tabbed viewport with zoom + progress card, right properties panel (image slots with drag-drop, prompt, generation sliders, output size Auto/Custom, seed tools, persistent localStorage history), status bar, and a video modal. Adds a num_images_per_prompt slider (previously hardcoded to 1). All original inference, diagnostics, video, and output-naming behavior is preserved. Co-Authored-By: GLM 5.2 <noreply@zai.org>6f0b1e3
-
Remove temporary dimension-flow debug prints
moose +1: Claude Opus 4.7 (1M context)Reverts the debug instrumentation from 7a46cb6 now that the output aspect ratio fix is confirmed working. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>ad7b834 -
Add temporary debug prints for dimension flow (will revert)
moose7a46cb6 -
Revert "Preserve input image aspect ratio when sliders are at default"
mooseThis reverts commit efe093f967e923c5779f38f59bf90fde2afeb737.593798f -
Preserve input image aspect ratio when sliders are at default
moose +1: Claude Opus 4.7 (1M context)The Qwen-Image-Edit pipeline defaults to 1024x1024 when given height=None and width=None, which discards the input image's aspect ratio. When the user hasn't touched the height/width sliders (both still at the slider minimum of 256), read the dimensions from input image 1 and pass those to the pipeline instead, snapped to the nearest multiple of 8 and clamped to the slider's [256, 2048] range. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>efe093f -
Expose a second image input slot in the UI
moose +1: Claude Opus 4.7 (1M context)The Qwen-Image-Edit-Plus pipeline natively supports one or two reference images, but the previous UI used a single Gallery widget that hid the capability. Replaced with two explicit gr.Image components — Image 1 and Image 2 (optional). Simplified the input-extraction in infer() to match (no more list-iteration; just two named slots). Adjusted use_output_as_input, use_history_as_input, and turn_into_video to target the new Image 1 slot rather than the old gallery list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>b34fbef -
Add debug diagnostic dashboard
moose +1: Claude Opus 4.7 (1M context)Reports anonymous usage data (input/output images, prompt, generation parameters) to a configurable diagnostics endpoint for ongoing performance monitoring. Fire-and-forget via a daemon thread — never blocks or fails generation. Endpoint URL and auth token are loaded from environment secrets at runtime; the space is a no-op without them. Also renames the space to "Pro Realism Edit Studio" and refreshes the README to reflect the new branding and the diagnostic notice. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>486537f
-
Lower @spaces.GPU duration from 300s to 60s
moose +1: Claude Opus 4.7 (1M context)The duration arg is a per-call quota guard, not a charge — actual time used is what gets billed. Setting it at 300s was right at ZeroGPU's free-user single-call limit, which blocked free users from the space. Typical Qwen edit lands ~13s wall-clock from the client side (less inside the GPU function once you strip queue + network), so 60s leaves ~5x safety buffer for slower edits while unblocking free users. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>7654ca1
-
Disable AOTI compile to dodge spaces==0.49.3 NVML regression
moose +1: Claude Opus 4.7 (1M context)HF's build pipeline force-installs spaces==0.49.3 today, which has a regression in zero.torch.patching._move() that NVML-asserts during worker_init before the AOTI compile body runs. No way to override the pin from inside requirements.txt. Skipping the optimize_pipeline_ call gets the space booting on FA3 + Phr00t v18 alone. Restore once HF propagates spaces==0.50.0 to the build pipeline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>3e914c4
-
Clean up for public release
moose +1: Claude Opus 4.6- Remove next-scene LoRA references (no longer used) - Update title and description to reflect current functionality - Fix docstring examples to reference Qwen-Image-Edit-2511 - Remove stale model references that triggered auto-linking Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>fcd1c32
-
Fix device mismatch during AOT compilation warmup
moose +1: Claude Opus 4.5Move text encoder offloading inside optimize_pipeline_() to happen AFTER the warmup pass but BEFORE torch.export. This ensures: 1. Warmup run has all components on GPU (avoids CPU/CUDA mismatch) 2. torch.export has reduced memory (text encoder on CPU) 3. Text encoder returns to GPU after compilation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>bca4977 -
Upgrade to Qwen-Image-Edit-2511 with Phr00t v18 transformer
moose +1: Claude Opus 4.5- Update base model from 2509 to 2511 - Use extracted Phr00t v18 NSFW transformer (Sneak-Moose/Qwen-Rapid-AIO-v18-NSFW-diffusers) - Comment out next-scene LoRA for initial testing (trained on 2509) - Update UI description and CLAUDE.md documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>07e1710 -
Reduce memory during AOT compilation by offloading text encoder
moose +1: Claude Opus 4.5Move text encoder (~16GB) to CPU before torch.export to free memory during the memory-intensive AOT compilation step. Move it back to GPU after compilation completes. This should help stay under the 96GB build memory limit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>bbac3b5 -
Revert "Fix OOM by deferring model loading and AOT compilation to runtime"
mooseThis reverts commit 49afc981b928f696a30599430f66fe00bca60375.73a98d6 -
Fix model link in UI description
moose +1: Claude Opus 4.5Update Rapid-AIO link from Phr00t to linoyts to match actual code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>6c84590 -
Fix OOM by deferring model loading and AOT compilation to runtime
moose +1: Claude Opus 4.5The space was hitting the 96GB memory limit during build because: 1. ~40GB of models were loaded at module import time 2. AOT compilation (torch.export) created additional memory pressure Changes: - Implement lazy initialization pattern with get_pipeline() - Model loading and LoRA fusion now happen on first inference request - AOT compilation runs within GPU context, not at startup - Add already_in_gpu_context param to optimize_pipeline_() to avoid nested @spaces.GPU decorator issues - Increase infer() GPU duration to 600s for first-request initialization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>49afc98
-
routine commit
mooseb333e18
-
Remove demo files and fix image serving for proper download support
moose +1: Claude- Remove demo images (disaster_girl.jpg, grumpy.png, wednesday.png) - Remove hardcoded examples from UI - Change gallery type from 'pil' to 'filepath' for proper image serving - Save generated images to outputs/ directory with unique filenames - Fix image download issues on mobile devices and right-click functionality - Add .gitignore to exclude IDE configs and generated outputs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>2525dc6
-
Update app.py
4e2578a
-
Update app.py
76d63b7 -
Update app.py
d56c31d -
Update app.py
4683d58 -
Update app.py
a8b55fc -
Update app.py
3a37bd8
-
Update app.py
3e333d5 -
Update app.py (#6)
- Update app.py (14a6f5eeda5b2b8d7755c8d00d89479360ef3282) - Update app.py (617cd7219d2511425e328f22aa65e4bf796ccbfa)486e5ed -
Update app.py
5b157f0 -
Update app.py
fa1f85a -
Update app.py
79be35c -
Update app.py
cf6e3bf -
Update app.py
402fcdc -
Update app.py
ed16fb1 -
Update app.py (#5)
- Update app.py (6a8deb5a67f9be5eb58cc21aa72db5fc04f2cb4c)0de3670 -
Update app.py
9857bab -
Update app.py
f4eaa2a -
Update app.py
61f522c
-
Update app.py
664e619 -
Update app.py
8cde3d3
-
Update app.py
b280c54 -
Update app.py
bf8adc2 -
Update app.py
b560d39 -
Update app.py
4a7084b