Spaces:
Running on Zero
A newer version of the Gradio SDK is available: 6.14.0
Embedded ComfyUI Backend
This Space keeps the Gradio UI and ZeroGPU decorator but runs generation through embedded ComfyUI nodes instead of Diffusers or a separate Comfy server.
Runtime Flow
app.pyvalidates Gradio inputs intoGenerationParams.src.comfy_backend.run_generation()initializes ComfyUI imports and model folder paths.- Comfy loader outputs for UNET, CLIP, and VAE are cached per worker.
- Before caching, the UNET may pass through
ModelSamplingAuraFlow(unlessZANIME_DISABLE_AURA_SAMPLING=1) to mirror the official Z-Anime workflow. - Each generation runs
CLIPTextEncode,EmptyLatentImage, nativeKSampler, andVAEDecode. - Decoded tensors become RGB
PIL.Imageobjects for the Gradio gallery.
No Comfy HTTP server (/prompt, websocket, etc.).
Only core Comfy nodes load by default; ModelSamplingAuraFlow is pulled from
comfy_extras.nodes_model_advanced without loading all optional node packs.
Set ZANIME_INIT_COMFY_EXTRA_NODES=1 only if you intentionally need broader Comfy extra/custom initialization.
Optional audio-related imports may pull torchaudio; by default a stub is installed when the real wheel is missing or incompatible.
Source And Models
ComfyUI source lives at ComfyUI/. If missing, the runtime downloads the
pinned archive (see COMFYUI_SOURCE.md), unless ZANIME_DISABLE_COMFY_SOURCE_FETCH=1.
Model layout under ZANIME_MODELS_ROOT or ComfyUI/models/:
diffusion_models/z-anime-distill-8step-fp8.safetensorstext_encoders/qwen_3_4b-fp8.safetensorsvae/ae.safetensors- optional mirror:
clip/qwen_3_4b-fp8.safetensors(bootstrap tries to hardlink/copy)
ZeroGPU Notes
Heavy work runs inside @spaces.GPU. Loader outputs stay cached per worker.
If Comfy removes CLIPLoader support for type="qwen_image" or changes loader APIs,
startup or first generation fails with a user-facing error.