Spaces:
Running on Zero
Running on Zero
Remove clip_skip; hide token-gated models (Civitai+FLUX); clearer Civitai error
Browse files- models.json +6 -3
- pipeline_manager.py +8 -5
models.json
CHANGED
|
@@ -57,7 +57,8 @@
|
|
| 57 |
"negative_prompt": "(worst quality, low quality:1.4), lowres, bad anatomy, bad hands, deformed, duplicate, watermark, text",
|
| 58 |
"default_steps": 28,
|
| 59 |
"default_guidance": 6.5,
|
| 60 |
-
"
|
|
|
|
| 61 |
},
|
| 62 |
{
|
| 63 |
"id": "asianrealistic-sdlife-v6",
|
|
@@ -75,7 +76,8 @@
|
|
| 75 |
"negative_prompt": "(worst quality, low quality:1.4), lowres, bad anatomy, bad hands, deformed, duplicate, watermark, text",
|
| 76 |
"default_steps": 28,
|
| 77 |
"default_guidance": 6.0,
|
| 78 |
-
"
|
|
|
|
| 79 |
},
|
| 80 |
{
|
| 81 |
"id": "sdxl-base",
|
|
@@ -111,7 +113,8 @@
|
|
| 111 |
"negative_prompt": "",
|
| 112 |
"default_steps": 4,
|
| 113 |
"default_guidance": 0.0,
|
| 114 |
-
"
|
|
|
|
| 115 |
},
|
| 116 |
{
|
| 117 |
"id": "flux-dev",
|
|
|
|
| 57 |
"negative_prompt": "(worst quality, low quality:1.4), lowres, bad anatomy, bad hands, deformed, duplicate, watermark, text",
|
| 58 |
"default_steps": 28,
|
| 59 |
"default_guidance": 6.5,
|
| 60 |
+
"_note": "needs CIVITAI_TOKEN in Space secrets to download — set it then flip enabled to true",
|
| 61 |
+
"enabled": false
|
| 62 |
},
|
| 63 |
{
|
| 64 |
"id": "asianrealistic-sdlife-v6",
|
|
|
|
| 76 |
"negative_prompt": "(worst quality, low quality:1.4), lowres, bad anatomy, bad hands, deformed, duplicate, watermark, text",
|
| 77 |
"default_steps": 28,
|
| 78 |
"default_guidance": 6.0,
|
| 79 |
+
"_note": "needs CIVITAI_TOKEN in Space secrets to download — set it then flip enabled to true",
|
| 80 |
+
"enabled": false
|
| 81 |
},
|
| 82 |
{
|
| 83 |
"id": "sdxl-base",
|
|
|
|
| 113 |
"negative_prompt": "",
|
| 114 |
"default_steps": 4,
|
| 115 |
"default_guidance": 0.0,
|
| 116 |
+
"_note": "FLUX.1-schnell is now gated + ~24GB (times out on ZeroGPU). Needs HF_TOKEN with access.",
|
| 117 |
+
"enabled": false
|
| 118 |
},
|
| 119 |
{
|
| 120 |
"id": "flux-dev",
|
pipeline_manager.py
CHANGED
|
@@ -167,6 +167,14 @@ def _download_url(url):
|
|
| 167 |
if not chunk:
|
| 168 |
break
|
| 169 |
out.write(chunk)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
return str(dest)
|
| 171 |
|
| 172 |
|
|
@@ -406,11 +414,6 @@ def run_generation(cfg, mode, prompt, negative_prompt, ref_image,
|
|
| 406 |
else:
|
| 407 |
call["guidance_scale"] = float(guidance)
|
| 408 |
call["negative_prompt"] = negative_prompt or None
|
| 409 |
-
# CLIP skip: registry stores the A1111 value (2 = skip one layer); diffusers
|
| 410 |
-
# counts skipped layers, so A1111 "2" == diffusers clip_skip=1.
|
| 411 |
-
a1111_cs = int(cfg.get("clip_skip", 1))
|
| 412 |
-
if a1111_cs > 1:
|
| 413 |
-
call["clip_skip"] = a1111_cs - 1
|
| 414 |
|
| 415 |
# ----- mode wiring -----
|
| 416 |
if mode == "txt2img":
|
|
|
|
| 167 |
if not chunk:
|
| 168 |
break
|
| 169 |
out.write(chunk)
|
| 170 |
+
# A real model is many MB; a tiny file means Civitai returned a login/redirect page.
|
| 171 |
+
if dest.stat().st_size < 1_000_000:
|
| 172 |
+
dest.unlink(missing_ok=True)
|
| 173 |
+
raise ValueError(
|
| 174 |
+
"ดาวน์โหลดโมเดลจาก Civitai ไม่สำเร็จ — โมเดลนี้ต้องตั้งค่า CIVITAI_TOKEN "
|
| 175 |
+
"ใน Space Settings → Variables and secrets ก่อน / Civitai download failed: "
|
| 176 |
+
"set CIVITAI_TOKEN in the Space secrets to use this model."
|
| 177 |
+
)
|
| 178 |
return str(dest)
|
| 179 |
|
| 180 |
|
|
|
|
| 414 |
else:
|
| 415 |
call["guidance_scale"] = float(guidance)
|
| 416 |
call["negative_prompt"] = negative_prompt or None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 417 |
|
| 418 |
# ----- mode wiring -----
|
| 419 |
if mode == "txt2img":
|