Spaces:
Runtime error
Runtime error
Commit History
-
Show export buttons only after successful generation, hide on reset
- Start both export rows hidden (visible=False) - Show on successful final yield in generate_standard_qr and generate_artistic_qr - Keep hidden during progressive generation yields - Hide when user clicks 'Try Another Example' - Hide when user selects a gallery example - Wire export_row_artistic/standard into all relevant .click() outputs listsff56691 -
Fix export temp files to use Gradio cache for privacy consistency
Write PNG and SVG export files into Gradio's /tmp/gradio/ cache via save_pil_to_cache / save_bytes_to_cache instead of bare /tmp, so delete_cache=(3600,3600) sweeps them after 1 hour — consistent with the generated image auto-delete policy stated in the README.b03ddfc -
Add one-click PNG and SVG export buttons to both tabs
- Add _make_qr_stem, _write_png, _write_svg helpers (top of file, after PIL import) - Add _download_png, _download_svg handler functions used as DownloadButton values - Add ⬇ PNG and ⬇ SVG DownloadButtons to Standard tab output column - Add ⬇ PNG and ⬇ SVG DownloadButtons to Artistic tab output column - Use gr.DownloadButton(value=Callable, inputs=[...]) pattern so files are generated on demand at click time — one click, no pre-caching - Write temp files to /tmp (OS-managed) not /tmp/gradio/, so they are not subject to the delete_cache=(3600, 3600) hourly sweep on the Space - SVG format is PNG-embedded-in-SVG: confirmed scannable, opens in Figma, Illustrator, Safari, and Chrome2be8221
-
Apply Stable Cascade filter to Tile ControlNet in first pass
- Change tile preprocessor to use qr_for_brightness instead of qr_with_border_noise - Now both brightness and tile ControlNets use the same filtered/raw QR input - Ensures consistent preprocessing across all first-pass ControlNets - Improves overall quality when filter is enabledb63dea3 -
Add Stable Cascade QR filter for artistic pipeline
- Implement apply_stable_cascade_qr_filter() using kornia HSV conversion - Add filter to artistic pipeline only (prevents grayscale output) - Use 3-level brightness quantization (0.0, 0.5, 1.0) for better ControlNet perception - Apply Gaussian blur (kernel=15) and adaptive thresholding (33% rule) - Add UI checkbox in artistic settings (disabled by default) - Fix parameter naming: rename 'progress' to 'gr_progress' throughout - Add enable_cascade_filter parameter to _pipeline_artistic() function Filter improves QR scannability by providing better brightness guidance to the brightness ControlNet while maintaining color output through FreeU/SAG enhancements.e2cedf0
-
Fix MPS device issues: gradient colors, device placement, and Gradio hot reload
This commit fixes three critical issues on Apple Silicon (MPS): 1. MPS Device Placement Bug (Second Pass) - Enhanced model (FreeU + SAG) had weights on CPU instead of MPS - Caused "RuntimeError: Tensor for argument weight is on cpu but expected on mps" - Fix: Recreate enhanced model before second refinement pass on MPS devices - Locations: app.py:2506-2531, 2539, 2574 2. Gradient Filter Color Quantization - Gradient filter showed black/white instead of blue/yellow on MPS - PIL incorrectly auto-detected grayscale mode during tensor conversion - Fix: Ensure RGB array shape before Image.fromarray() calls - No deprecated 'mode' parameter (future-proof for Pillow 13) - Locations: app.py:967-981, 2172-2178, 2207-2213, 2639-2645, 2668-2674 3. Gradio Hot Reload Support - Import errors: "No module named 'utils.extra_config'" - Missing 'demo' attribute error during reload - Fix: Graceful import fallback, move app to module level, init guard - Locations: …1d3c29b
-
Increase zero GPU timeout by 10% to prevent user timeouts
Updated all dynamic duration calculations with additional 10% buffer: - Standard pipeline: 32% safety margin (was 20%) - Artistic pipeline: 37.5% safety margin (was 25%) This ensures users have sufficient time to complete generations across all configurations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>d8f6a5a
-
Add comprehensive accelerate and H100 optimization guide
Added sections: - Accelerate configuration for single vs multi-GPU - H100-optimized training parameters and batch sizes - Single H100 optimized command (batch_size=32, 99k in 45min) - 6× H100 multi-GPU command (batch_size=24/GPU, 3M in 4hrs) - Batch size selection guide for different GPU configs - Memory optimization tips and OOM troubleshooting Key recommendations: - Single H100: batch_size=32, grad_accum=4 (effective=128) - 6× H100: batch_size=24/GPU, grad_accum=2 (effective=288) - Added dataloader_num_workers=8 for faster data loading - Added set_grads_to_none for faster gradient zeroing - More frequent checkpointing for H100 (every 750 steps)82b2bf3 -
Revise training plan for single GPU H100 on Lightning.ai
Key updates: - Lightning.ai Free tier: Single H100 only (no multi-GPU) - Pro plan (/month annual): Up to 6 GPUs multi-node training - Single H100 training times: 45 min (99k), 4 hrs (500k), 24 hrs (3M) - 6× H100 (Pro) training times: 7.5 min (99k), 40 min (500k), 4 hrs (3M) - Multi-GPU costs same total (6× faster but 6× more expensive/hr) Recommendations: - Start with Free tier 99k test: $1.88, 45 minutes - If promising, choose based on urgency: - Budget: Free tier 3M training ($60, 24 hours) - Speed: Pro plan 3M training ($80, 4 hours) - Pro plan worth it if: need results same day, testing multiple configs - Total investment: $62-$82 vs $900+ on old A100 plan4670d25 -
Update training plan with H100 cost-performance analysis
- H100 is 6.3x faster than A100 (1979 vs 312 TFLOPs) - H100 costs only 1.46x more (.42 vs .96/hr) - Net result: 4.3x better cost efficiency - 99k training: 45 min on H100 vs 4-6 hours on A100 - Full 3M training: ~2 hours on H100 vs 19-25 days on single GPU - Total cost savings: -780 per training cycle - Timeline reduced from 5 days to 1 dayce13bdc -
Make Try Another Example select random different example with auto-loaded settings
37e1546 -
Fix missing enable_animation parameter in artistic pipeline JSON loader
Fixed ValueError where load_settings_from_json_artistic returned 32 values instead of required 33. Added missing enable_animation parameter extraction and return value to match the UI output components. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>8ff8a20
-
Update GPU quota information and add Zero GPU error guidance
Enhanced the main description with detailed GPU quota information including image size specifications and added helpful guidance for users encountering Zero GPU errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>7c43bef -
Update example images and settings
Images updated: - Roman City: New QR code image - Poker Chips: New QR code image - Underwater Fish: New QR code image Settings updated: - Poker Chips: sag_blur_sigma 2.5 → 1.5 - Underwater Fish: sag_blur_sigma 0.5 → 1.5, seed 718313 → 3048334933 All images kept in original formats (mix of jpg and webp). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>cd5547a -
Update Mediterranean Garden example image
Replaced with new image featuring stone architecture, columns, fountains and lush Mediterranean garden with bokeh effect. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>c25ccc4 -
Update Mediterranean Garden example settings
Changed Mediterranean Garden example: - URL: Calendar event → https://www.google.com - Input type: Plain Text → URL - Image size: 1024 → 704 Note: Example image also updated (separate commit) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>5c6a220 -
Add actual GPU time tracking logs
Added timing logs to track actual GPU time spent vs requested duration: Logs at start: [GPU TIMING] Started generation: pipeline=X, image_size=Y, animation=Z, upscale=W Logs at end: [GPU TIMING] Completed generation in X.XXs (pipeline=Y, image_size=Z) Combined with duration debug logs, this provides complete visibility: - Requested duration (from get_dynamic_duration) - Actual time spent - All parameters used This allows monitoring and tuning duration calculations based on real usage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>fc00637 -
Fix GPU duration calculation and reduce safety margins
CRITICAL FIX: ZeroGPU passes image_size as positional argument (args[4]), not in kwargs. Previous code always used default 512, causing timeouts. This is why 1024px artistic was getting only 30s (duration for 512px) instead of proper duration for 1024px. Changes: - Extract image_size from args[4] (the actual value passed) - Reduce safety margins from 40-50% back to 20-25% - Standard pipeline: 20% margin - Artistic pipeline: 25% margin New durations (with corrected image_size extraction): Standard: 512=12s, 832=24s, 1024=48s (with animation) Artistic: 512=22s, 768=44s, 832=56s, 1024=94s (without upscale) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>cb843dd -
Fix gallery selection when clicking "Try Another Example"
When user clicks "Try Another Example" button, the gallery now shows all images unselected (selected_index=None) for a clean browsing experience. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>aa46d4a -
Add debug logging to GPU duration calculation
Added comprehensive logging to get_dynamic_duration function to debug why 1024px artistic is only getting 32 seconds instead of 100-120s. Logs will show: - All args and kwargs received by the function - Extracted parameter values (pipeline, image_size, animation, upscale) - Calculated duration before and after capping Check HuggingFace Space logs to see what's happening. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>6c37137 -
Increase artistic pipeline GPU durations to ensure completion
User reported 768px artistic with animation stopped at 20/30 steps with 50s. Increased all artistic durations with larger safety margins (40-50%): - 512px: 25s → 30s (without upscale), 38s → 45s (with upscale) - 640px: 35s → 40s (without upscale), 52s → 58s (with upscale) - 768px: 50s → 65s (without upscale), 68s → 85s (with upscale) - 832px: 65s → 75s (without upscale), 82s → 95s (with upscale) - 1024px: 90s → 100s (without upscale), 120s (with upscale) This ensures all 30 steps complete successfully for artistic generations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>a99fdc5 -
Remove incorrect FLUX.1-dev references from documentation
The Artistic pipeline does not use FLUX.1-dev, so removed all references to it from both Artistic and Standard QR tab documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>43227ad -
Improve UI/UX, fix ControlNet device placement, and increase GPU durations
UI/UX improvements: - Implement two-column layout for both Artistic and Standard QR tabs - Move examples gallery to right column with visibility toggle - Add "Try Another Example" button to return to gallery after generation - Simplify main description and add tab-specific documentation in accordions - Consolidate all user feedback in Status/Errors textbox - Add gr.Examples for Standard QR with preset configurations ControlNet device placement fixes: - Fix MPS device error by ensuring control_model matches input tensor device (comfy/controlnet.py:273) - Ensure time_embed receives tensors on correct device (comfy/cldm/cldm.py:384) - Fixes "Tensor for argument weight is on cpu but expected on mps" error GPU duration optimizations: - Increase safety margins from 20% to 30-40% to prevent timeouts - Standard 832px: 24s → 30s (with animation) - Artistic 768px: 40s → 50s (without upscale) - fixes poker, rice fields - Artistic 1024px: 72s → 90s (without upscale) - fixes mediterranean garden …ac283cb -
Remove selected_index from gallery for better PC UX
Removed selected_index=0 so PC users see the full 3x3 grid instead of having one image pre-selected. Mobile users can still tap any image to view it larger. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>a564766 -
Fix: Revert share=True to share=False
Accidentally changed share=False to share=True in the gallery refactoring commit. Reverting to share=False as it should be. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>e8b3cf1 -
Add selected_index to gallery for better mobile UX
Set first example image to be pre-selected (selected_index=0) so it opens in preview mode by default. This makes gallery images larger and more visible on mobile devices. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>65d35fe -
Refactor artistic examples to use gr.Gallery instead of manual grid
Replaced 400+ lines of repetitive code (9 images + 9 buttons + 9 handlers) with a clean data-driven gr.Gallery implementation. Changes: - Added ARTISTIC_EXAMPLES data structure (lines 2553-2689) - Replaced manual 3x3 grid with gr.Gallery component (lines 3273-3282) - Single click handler using gr.SelectData (lines 3285-3320) - Users click images directly to load settings (no separate buttons) Benefits: - 75% less code (~90 lines vs ~400 lines) - Easier to maintain (add examples by updating list) - Better UX (native gallery with preview, cleaner interface) - All example data organized in one place 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>4f5b94c -
Fix image flash bug - remove 4 unnecessary yields
Removed yields that caused brief flashes of outdated images before showing properly decoded results. This affected both standard and artistic pipelines during first and second enhancement passes. Removed yields: - Standard line 1944: Black/white QR after first sampling - Standard line 2031: First pass result after second sampling - Artistic line 2369: Old QR after first sampling - Artistic line 2464: First pass result after second sampling Users now see smooth progression from animation frames directly to final decoded images without intermediate flashes. Progress messages still update via log_progress(). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>5b93491 -
Fix ASGI protocol violation with ZeroGPU generator functions
Added explicit return statements after final yields in generate_qr_code_unified to prevent race condition during GPU release. This fixes the ASGI error that only occurs on HuggingFace Spaces: AssertionError: Unexpected message: {'type': 'http.response.start'...} Changes: - Standard pipeline with upscaling (line 2095) - Standard pipeline without upscaling (line 2123) - Artistic pipeline with upscaling (line 2523) - Artistic pipeline without upscaling (line 2545) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>ab7b2f9 -
Update GPU quota notice to be more accurate and encouraging
Changed quota descriptions to show realistic generation counts instead of worst-case scenarios. Unauthenticated users can get ~6 artistic generations (not just 1), and authenticated users get ~10. Clarified that 120s is only for maximum settings (1024px with upscaling) while default 512px takes ~20s. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>5da7220
-
Fix dynamic duration function signature for ZeroGPU compatibility
- Change get_dynamic_duration to accept *args, **kwargs - Extract only needed parameters (pipeline, image_size, enable_animation, enable_upscale) - Fixes TypeError: got multiple values for argument 'pipeline' - ZeroGPU decorator passes all function arguments to duration function 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>76bef0b -
Add final GPU optimization tips and pipeline comparisons
- Add recommended settings (512px, animation on, upscaling off) at ~10-12s - Specify ~20% GPU time savings for disabling animation - Add Standard pipeline is ~2x faster than Artistic for quota management - Note that color quantization has no GPU time impact - Clarify pipeline trade-offs for user decision making 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>039884f -
Implement dynamic GPU duration based on pipeline settings
- Add get_dynamic_duration() function with benchmark-based calculations - Standard: 512+anim=12s, 832+anim=24s, 1024=48s (with 20% safety margin) - Artistic: 640+anim=28s, 832+anim=54s, 1024+anim+upscale=120s (capped) - Duration adjusts based on pipeline, image size, animation, and upscaling - All durations capped at 120s (unauthenticated user limit) - Add critical warning about upscaling impact on large resolutions (832px+) - Update GPU quota notice with specific guidance 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>c8f25d7 -
Optimize GPU quota usage and add authentication notices
- Reduce ZeroGPU duration from 150 to 120 seconds (unauthenticated limit) - Disable upscaling by default in artistic pipeline to save GPU time - Add GPU quota notice for authenticated vs unauthenticated users - Add warning about large image sizes (1024px) exceeding quota - Add tip to disable animation and upscaling to maximize quota - Update default enable_upscale to False in function and JSON loader - Update UI descriptions for upscaling and quota management 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>8cdb002 -
Fix animation compatibility with AOTI compilation and inference mode
- Disable animation during AOTI compilation and warmup (4 places) - Change torch.inference_mode() to torch.no_grad() for animation compatibility - Fixes "Inference tensors do not track version counter" error - Fixes "CapturedCallException" during AOTI compilation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>61084b9 -
Add animation feature and remove FreeU from standard pipeline
- Add KSampler animation with intermediate frame preview every 5 steps - Fix VAE latent scaling (0.18215) for proper preview image quality - Remove FreeU from standard pipeline (kept in artistic only) - Increase ZeroGPU duration from 120 to 150 seconds - Update seed range to 2^32-1 for JSON compatibility - Update UI descriptions for animation, color quantization, and upscale - Set artistic pipeline defaults to Japanese temple example - Add "Change Settings Manually" section descriptions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>08c63d3
-
Update step counters to account for color quantization feature
- Add dynamic total_steps calculation based on enabled features - Update all progress messages to use dynamic step counters - Add progress messages when applying color quantization - Handle both upscaling and non-upscaling paths correctly Step flows now vary from 3 to 5 steps depending on features enabled: - Base: 3 steps (QR generation, first pass, second pass) - +1 step if upscaling is enabled - +1 step if color quantization is enabled 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>d965bc8 -
Increase GPU space time from 60 to 90 seconds
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>e5c0d2f
-
Add negative prompt support to both pipelines and settings
Add customizable negative prompt parameter to control unwanted elements: - Add negative_prompt parameter to both standard and artistic pipelines - Add negative prompt UI component in "Change Settings Manually" accordion - Include negative_prompt in settings JSON export/import for both pipelines - Update all warmup calls to include negative_prompt parameter - Convert pipeline calls to keyword arguments to prevent parameter misalignment - Update event handlers to include negative_prompt in inputs/outputs - Default: "ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft, closed eyes, text, logo" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>0116bd4 -
Add gradient color filter to quantization feature
Integrate gradient filter as optional enhancement to color quantization: - Add apply_color_quantization() with gradient mode support - Preserve QR colors (1-2) while applying gradients to background (3-4) - Add UI controls for gradient strength and variation steps - Update both Standard and Artistic pipelines - Include gradient parameters in settings export/import - Fix event handler placement for proper component references 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>a3a5777
-
udate pizza example
151a131
-
Fix CUDA initialization error: call compile_models_with_aoti() inside main block after ZeroGPU init
c883ade -
Switch torch.compile mode from 'reduce-overhead' to 'max-autotune' for faster inference
3490b07 -
Add .detach() before all .cpu().numpy() calls to fix gradient error with torch.compile
1652ae0 -
Fix all warmup parameters: border_size=4, error_correction='Medium (15%)', module_size=12, module_drawer='Square'
4eba716 -
Fix warmup parameters: use module_size=12 and error_correction='Medium (15%)' to match generate_all_triton_kernels.py
89a59b3 -
Fix module_drawer parameter: use 'Square' instead of 'square'
72ccbb3 -
Fix AOTI: use correct imports (aoti_capture, aoti_compile, aoti_apply) with torch.compile fallback
f205cc5 -
Simplify AOT compilation: use aoti_compile_model API instead of full pipeline
b09e131 -
Fix AOT compilation: use qr_text parameter instead of text_input
eee3359