File size: 1,524 Bytes
de2b117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/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)