Spaces:
Running on Zero
Running on Zero
fix(realesrgan): switch repo from xinntao/Real-ESRGAN to lllyasviel/Annotators
Browse filesxinntao/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.
README.md
CHANGED
|
@@ -13,7 +13,7 @@ preload_from_hub:
|
|
| 13 |
- Tongyi-MAI/Z-Image transformer/diffusion_pytorch_model.safetensors,text_encoder/*.safetensors,vae/diffusion_pytorch_model.safetensors,tokenizer/*
|
| 14 |
- Tongyi-MAI/Z-Image-Turbo transformer/diffusion_pytorch_model.safetensors
|
| 15 |
- PAI/Z-Image-Turbo-Fun-Controlnet-Union-2.1 Z-Image-Turbo-Fun-Controlnet-Union-2.1-8steps.safetensors
|
| 16 |
-
-
|
| 17 |
---
|
| 18 |
|
| 19 |
# z-image-studio
|
|
|
|
| 13 |
- Tongyi-MAI/Z-Image transformer/diffusion_pytorch_model.safetensors,text_encoder/*.safetensors,vae/diffusion_pytorch_model.safetensors,tokenizer/*
|
| 14 |
- Tongyi-MAI/Z-Image-Turbo transformer/diffusion_pytorch_model.safetensors
|
| 15 |
- PAI/Z-Image-Turbo-Fun-Controlnet-Union-2.1 Z-Image-Turbo-Fun-Controlnet-Union-2.1-8steps.safetensors
|
| 16 |
+
- lllyasviel/Annotators RealESRGAN_x4plus.pth
|
| 17 |
---
|
| 18 |
|
| 19 |
# z-image-studio
|
app.py
CHANGED
|
@@ -73,7 +73,7 @@ def _esrgan_path() -> str:
|
|
| 73 |
"""Locate the preloaded RealESRGAN_x4plus.pth."""
|
| 74 |
from huggingface_hub import hf_hub_download
|
| 75 |
|
| 76 |
-
return hf_hub_download("
|
| 77 |
|
| 78 |
|
| 79 |
def on_t2i_generate(prompt, negative_prompt, model, steps, cfg, width, height, seed, lora_path, lora_strength):
|
|
|
|
| 73 |
"""Locate the preloaded RealESRGAN_x4plus.pth."""
|
| 74 |
from huggingface_hub import hf_hub_download
|
| 75 |
|
| 76 |
+
return hf_hub_download("lllyasviel/Annotators", "RealESRGAN_x4plus.pth")
|
| 77 |
|
| 78 |
|
| 79 |
def on_t2i_generate(prompt, negative_prompt, model, steps, cfg, width, height, seed, lora_path, lora_strength):
|
docs/superpowers/plans/2026-05-13-z-image-studio.md
CHANGED
|
@@ -2136,7 +2136,7 @@ def _coerce_lora(lora_path: str | None) -> Path | None:
|
|
| 2136 |
def _esrgan_path() -> str:
|
| 2137 |
"""Locate the preloaded RealESRGAN_x4plus.pth."""
|
| 2138 |
from huggingface_hub import hf_hub_download
|
| 2139 |
-
return hf_hub_download("
|
| 2140 |
|
| 2141 |
|
| 2142 |
def on_t2i_generate(prompt, negative_prompt, model, steps, cfg,
|
|
@@ -2298,7 +2298,7 @@ preload_from_hub:
|
|
| 2298 |
- Tongyi-MAI/Z-Image transformer/diffusion_pytorch_model.safetensors,text_encoder/*.safetensors,vae/diffusion_pytorch_model.safetensors,tokenizer/*
|
| 2299 |
- Tongyi-MAI/Z-Image-Turbo transformer/diffusion_pytorch_model.safetensors
|
| 2300 |
- PAI/Z-Image-Turbo-Fun-Controlnet-Union-2.1 Z-Image-Turbo-Fun-Controlnet-Union-2.1-8steps.safetensors
|
| 2301 |
-
-
|
| 2302 |
---
|
| 2303 |
|
| 2304 |
# z-image-studio
|
|
@@ -2512,7 +2512,7 @@ def test_upscale_produces_image(real_backend, tmp_path):
|
|
| 2512 |
input_image=Image.fromarray(arr),
|
| 2513 |
refine_steps=5, refine_denoise=0.33, seed=42,
|
| 2514 |
lora_path=None, lora_strength=0.0,
|
| 2515 |
-
esrgan_model_path=hf_hub_download("
|
| 2516 |
"RealESRGAN_x4plus.pth")),
|
| 2517 |
)
|
| 2518 |
assert image.size == (512, 512)
|
|
|
|
| 2136 |
def _esrgan_path() -> str:
|
| 2137 |
"""Locate the preloaded RealESRGAN_x4plus.pth."""
|
| 2138 |
from huggingface_hub import hf_hub_download
|
| 2139 |
+
return hf_hub_download("lllyasviel/Annotators", "RealESRGAN_x4plus.pth")
|
| 2140 |
|
| 2141 |
|
| 2142 |
def on_t2i_generate(prompt, negative_prompt, model, steps, cfg,
|
|
|
|
| 2298 |
- Tongyi-MAI/Z-Image transformer/diffusion_pytorch_model.safetensors,text_encoder/*.safetensors,vae/diffusion_pytorch_model.safetensors,tokenizer/*
|
| 2299 |
- Tongyi-MAI/Z-Image-Turbo transformer/diffusion_pytorch_model.safetensors
|
| 2300 |
- PAI/Z-Image-Turbo-Fun-Controlnet-Union-2.1 Z-Image-Turbo-Fun-Controlnet-Union-2.1-8steps.safetensors
|
| 2301 |
+
- lllyasviel/Annotators RealESRGAN_x4plus.pth
|
| 2302 |
---
|
| 2303 |
|
| 2304 |
# z-image-studio
|
|
|
|
| 2512 |
input_image=Image.fromarray(arr),
|
| 2513 |
refine_steps=5, refine_denoise=0.33, seed=42,
|
| 2514 |
lora_path=None, lora_strength=0.0,
|
| 2515 |
+
esrgan_model_path=hf_hub_download("lllyasviel/Annotators",
|
| 2516 |
"RealESRGAN_x4plus.pth")),
|
| 2517 |
)
|
| 2518 |
assert image.size == (512, 512)
|
docs/superpowers/specs/2026-05-13-z-image-studio-design.md
CHANGED
|
@@ -336,7 +336,7 @@ preload_from_hub:
|
|
| 336 |
- Tongyi-MAI/Z-Image transformer/diffusion_pytorch_model.safetensors,text_encoder/*.safetensors,vae/diffusion_pytorch_model.safetensors,tokenizer/*
|
| 337 |
- Tongyi-MAI/Z-Image-Turbo transformer/diffusion_pytorch_model.safetensors
|
| 338 |
- PAI/Z-Image-Turbo-Fun-Controlnet-Union-2.1 Z-Image-Turbo-Fun-Controlnet-Union-2.1-8steps.safetensors
|
| 339 |
-
-
|
| 340 |
---
|
| 341 |
```
|
| 342 |
|
|
|
|
| 336 |
- Tongyi-MAI/Z-Image transformer/diffusion_pytorch_model.safetensors,text_encoder/*.safetensors,vae/diffusion_pytorch_model.safetensors,tokenizer/*
|
| 337 |
- Tongyi-MAI/Z-Image-Turbo transformer/diffusion_pytorch_model.safetensors
|
| 338 |
- PAI/Z-Image-Turbo-Fun-Controlnet-Union-2.1 Z-Image-Turbo-Fun-Controlnet-Union-2.1-8steps.safetensors
|
| 339 |
+
- lllyasviel/Annotators RealESRGAN_x4plus.pth
|
| 340 |
---
|
| 341 |
```
|
| 342 |
|
tests/test_smoke_gpu.py
CHANGED
|
@@ -92,7 +92,7 @@ def test_upscale_produces_image(real_backend, tmp_path):
|
|
| 92 |
seed=42,
|
| 93 |
lora_path=None,
|
| 94 |
lora_strength=0.0,
|
| 95 |
-
esrgan_model_path=hf_hub_download("
|
| 96 |
),
|
| 97 |
)
|
| 98 |
assert image.size == (512, 512)
|
|
|
|
| 92 |
seed=42,
|
| 93 |
lora_path=None,
|
| 94 |
lora_strength=0.0,
|
| 95 |
+
esrgan_model_path=hf_hub_download("lllyasviel/Annotators", "RealESRGAN_x4plus.pth"),
|
| 96 |
),
|
| 97 |
)
|
| 98 |
assert image.size == (512, 512)
|