Download root-scripts/run_casefix.py from hipinis/20260718: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/hipinis/20260718/resolve/main/root-scripts/run_casefix.py
- Command line
-
hf download hf://hipinis/20260718/root-scripts/run_casefix.py
-
curl -L -o run_casefix.py https://huggingface.co/hipinis/20260718/resolve/main/root-scripts/run_casefix.py
1.52 kB
| #!/usr/bin/env python3 | |
| """Machine-side: B1 single-image edit for EP1S1_F05 guitar-case -> violin-case local fix. | |
| Input /workspace/facefix_in/EP1S1_F05_case_edit.png ; output /workspace/facefix_out/EP1S1_F05_case_b1.png | |
| """ | |
| import sys, time | |
| sys.path.insert(0, "/workspace/projects/qwen21-nsfw-pose/scripts") | |
| from qwen_pose_test import run, upload_image | |
| from pathlib import Path | |
| IN = Path("/workspace/facefix_in") | |
| OUT = Path("/workspace/facefix_out"); OUT.mkdir(exist_ok=True) | |
| PROMPT = ("图1是电影剧照的局部画面。把图1中靠墙斜立着的黑色琴盒改成小提琴形的黑色硬质琴盒:" | |
| "盒身轮廓是小提琴的曲线形、两端圆润、中段收腰,体积小巧,黑色硬壳表面带细腻皮纹、银色锁扣与提手," | |
| "斜靠墙面的姿势、倾斜角度、受光方向与阴影和图1完全一致;" | |
| "图1中的木门、墙面、地面、灌木、光线、色调、构图与图1完全一致,写实照片质感,细节真实。") | |
| src = IN / "EP1S1_F05_case_edit.png" | |
| out = OUT / "EP1S1_F05_case_b1.png" | |
| cfg = { | |
| "mode": "edit", "name": "rework1/F05_case", | |
| "image_name": upload_image(src), "source": str(src), | |
| "prompt": PROMPT, "negative": "", | |
| "seed": 920137, "steps": 40, "cfg": 1.0, | |
| "sampler": "euler", "scheduler": "simple", "denoise": 1.0, | |
| "resolution": 1280, "out": str(out), | |
| } | |
| t0 = time.time() | |
| res = run(cfg) | |
| print("done F05_case ok=", res["ok"], "secs=", res.get("seconds"), "wall=", round(time.time() - t0), flush=True) | |