Spaces:
Running on Zero
Running on Zero
Commit History
-
perf(preload): broaden globs to capture configs + index.jsons (~47 GB total)
Unverified signatureOld preload listed only *.safetensors and tokenizer/*, which missed: - text_encoder/config.json + model.safetensors.index.json (shard map) - transformer/config.json + .index.json - vae/config.json - scheduler/scheduler_config.json - model_index.json (diffusers top-level) Result: every cold-start inference fired 5-8 small hf_hub_download calls to fill those gaps before the pipeline could load. Annoying first-call latency on the Space. Broaden to transformer/* etc. so HF preload pulls each subdir wholesale. Skip the shared encoder/vae/tokenizer from Z-Image-Turbo (identical to Base's). Keep alibaba-pai and lllyasviel/Annotators tight — their repos contain other models we don't want. Sizes (from HF API): Tongyi-MAI/Z-Image: ~20.6 GB Tongyi-MAI/Z-Image-Turbo: ~24.6 GB (transformer subdir only) alibaba-pai/...Union-2.1: ~2 GB (one file) lllyasviel/Annotators: 67 MB (one file) ────────────────────────────────── Total: ~47 GB (cap is 150 …6bd8e31 -
fix: pool-stashed transformer swap + MPS-safe vram + corrected model-zoo anchor
Unverified signatureThree coupled fixes uncovered by the first real Generate click locally: 1. AttributeError: 'ZImagePipeline' object has no attribute 'model_pool' DiffSynth's from_pretrained builds a fresh ModelPool, attaches pipe.dit/ pipe.text_encoder/etc. from it, then discards the pool. My _swap_transformer in modes.py assumed pipe.model_pool persisted. Replace from_pretrained call with a manual replication that stashes the pool on pipe._zis_pool, then index into pool.model for the two z_image_dit entries (Base loaded first, Turbo second per MODEL_CONFIGS order). fetch_model can't distinguish them since both register under the same name. 2. AttributeError: module 'torch.mps' has no attribute 'mem_get_info' DiffSynth's AutoWrappedModule.forward gates module load on check_free_vram (vram/layers.py:195), which calls torch.<device>.mem_get_info — CUDA-only. The escape hatch is vram_limit=None, which short-circuits the gate. Update models.vram_limit_for('mps') -> None (…0cf8ffc -
fix(deploy): switch model lookups to HF + fix ZeroGPU build
Unverified signatureMultiple issues caught in the HF Space build cycle: 1. DiffSynth defaults to ModelScope, not HF. Set DIFFSYNTH_DOWNLOAD_SOURCE= huggingface in app.py before imports so preload_from_hub + HF cache work. 2. PAI/Z-Image-Turbo-Fun-Controlnet-Union-2.1 is the ModelScope slug. On HF the mirror is alibaba-pai/... — update models.py + README + spec + test. 3. ZeroGPU build appends spaces==0.50.0 to the install line, conflicting with our spaces==0.30.0 pin. Drop the pin entirely — HF provides the right one. 4. DiffSynth resolves models at ./models/<repo>/, not ~/.cache/huggingface/hub. Add models.symlink_hf_cache_to_diffsynth_layout() that creates symlinks from cache snapshots to that layout. Wire into _bootstrap() so the preload weights are actually findable at runtime (otherwise the Space re-downloads all 30 GB on first call). 5. Set DIFFSYNTH_MODEL_BASE_PATH=<repo>/models in _bootstrap(). 6. Add models/ to .gitignore. 7. _bootstrap() now also runs locally (just th…99302bc -
fix(realesrgan): switch repo from xinntao/Real-ESRGAN to lllyasviel/Annotators
Unverified signaturexinntao/Real-ESRGAN doesn't exist on HF (returns 401) — the canonical weights live in GitHub releases. lllyasviel/Annotators mirrors the same 67 MB RealESRGAN_x4plus.pth and serves it cleanly via HF Hub. Caught when the HF Space build hit RUNTIME_ERROR on preload. Updates: README preload_from_hub, app._esrgan_path(), spec, plan.213bf15 -
refactor(tooltips): rename copy.py → tooltips.py to avoid stdlib shadow
Unverified signatureThe original copy.py shadowed Python's stdlib copy module, requiring a fragile conftest hack to pre-import torch/pydantic/fastapi/gradio so they captured the real stdlib before sys.modules['copy'] was swapped. That coupling — every new dep with a lazy 'from copy import deepcopy' would silently break tests — is bad enough to avoid entirely. Rename to tooltips.py. conftest.py reverts to a simple sys.path insert. Spec and plan amendments updated.0592951 -
docs: amend spec + plan with param tooltips and coming-soon model placeholders
Unverified signature- Spec § 4.4 updated: every component uses show_label=False with a labeled_label() HTML prefix. T2I model selector becomes custom HTML with a hidden gr.Textbox carrying the state. - Spec § 4.6 (new): tooltip pattern (subtle circled (i) superscript; hover desktop / tap-pin mobile; copy lives in copy.py). - Spec § 4.7 (new): coming-soon model placeholders for Z-Image-Edit and Z-Image-Omni-Base; disabled cards are <a> elements opening github.com/Tongyi-MAI/Z-Image#model-zoo. - Spec § 5: copy.py added to file layout. - Spec § 11: 3 new implicit decisions + 1 new out-of-scope item. - Plan: amendment section with Tasks A (copy.py), B (theme CSS extensions), C (ui.py helpers) plus modifications to existing Task 14 and Task 15.86c22f6 -
docs: implementation plan for z-image-studio (19 tasks)
Unverified signatureTDD-driven plan covering: scaffolding, onyx amber theme, device/model config registry, hf cache mirror, lora sniff + apply/revert ctx, controlnet preprocessors, realesrgan upscale wrapper, three mode handlers (t2i/controlnet/upscale), zerogpu duration estimator, backend dispatch, gradio ui builders, app entrypoint, readme + hf space yaml, ci workflow, l3 gpu smoke, hf space deploy.0aed297 -
docs: initial design spec for z-image-studio
Unverified signatureGradio app for Z-Image + Z-Image-Turbo via DiffSynth-Studio (no ComfyUI). Three tabs (T2I dual-model / ControlNet Union / Upscale RealESRGAN+refine), per-tab LoRA loader, MPS+CUDA dual-device, eager preload, Onyx Amber theme.9ee5274