- 新增 render_native.py: 台词镜缝合(保留原生音轨+烧h3v3字幕+瑕疵遮盖,不叠TTS) - 新增 fetch_t2i.py: 出图脚本被杀后按pid救回单图 - 修复 queue_h3_native.py --check 将中断/error误判为在队的bug - 文档: render.md/native-av.md/pitfalls.md/SKILL.md/README 补齐双轨缝合与选机实测
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""取回一个已在 ComfyUI 服务端跑着的 t2i 任务的产物(提交脚本被杀后恢复用)。
|
|
|
|
用法: python3 tools/fetch_t2i.py --pid <pid> --out <本地png路径> [--host http://192.168.1.30:30113] [--timeout 3600]
|
|
复用 submit_t2i.py 的 wait/find_image/download/sanity_check,不重复造轮子。
|
|
"""
|
|
import argparse
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
import submit_t2i as T
|
|
|
|
|
|
def main():
|
|
ap = argparse.ArgumentParser()
|
|
ap.add_argument("--pid", required=True)
|
|
ap.add_argument("--out", required=True)
|
|
ap.add_argument("--host", default="http://192.168.1.30:30113")
|
|
ap.add_argument("--timeout", type=int, default=3600)
|
|
a = ap.parse_args()
|
|
|
|
print("等待 pid %s (host %s) ..." % (a.pid, a.host), flush=True)
|
|
item = T.wait(a.host, a.pid, a.timeout)
|
|
f = T.find_image(item)
|
|
size = T.download(a.host, f, a.out)
|
|
print("已下载 %s (%d bytes)" % (a.out, size), flush=True)
|
|
ok = T.sanity_check(a.out)
|
|
print("自检:", ok, flush=True)
|
|
return 0 if ok else 2
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|