Commit 26e80b10 authored by jerrrrry's avatar jerrrrry
Browse files

Update wan_t2v_14B_1_gpu.py

parent d5333583
import json import json
from urllib import request from urllib import request
import argparse
# 解析命令行参数
parser = argparse.ArgumentParser(description='Run ComfyUI API with custom seed')
parser.add_argument('--seed', type=int, default=2675441231, help='Seed for generation')
args = parser.parse_args()
#This is the ComfyUI api prompt format. #This is the ComfyUI api prompt format.
# (你的原始prompt_text保持不变)
#If you want it for a specific workflow you can "enable dev mode options"
#in the settings of the UI (gear beside the "Queue Size: ") this will enable
#a button on the UI to save workflows in api format.
#keep in mind ComfyUI is pre alpha software so this format will change a bit.
#this is the one for the default workflow
prompt_text = """ prompt_text = """
{ {
"3": { "3": {
"inputs": { "inputs": {
"seed": 2675441231, // 这个值会被下面的代码替换 "seed": 2675441231,
"steps": 20, "steps": 20,
"cfg": 6, "cfg": 6,
"sampler_name": "uni_pc", "sampler_name": "uni_pc",
...@@ -174,14 +175,14 @@ def queue_prompt(prompt): ...@@ -174,14 +175,14 @@ def queue_prompt(prompt):
prompt = json.loads(prompt_text) prompt = json.loads(prompt_text)
# 使用命令行参数中的seed值替换默认值
prompt["3"]["inputs"]["seed"] = args.seed
#set the text prompt for our positive CLIPTextEncode #set the text prompt for our positive CLIPTextEncode
#prompt["6"]["inputs"]["text"] = "masterpiece best quality man" #prompt["6"]["inputs"]["text"] = "masterpiece best quality man"
#set the seed for our KSampler node #set the seed for our KSampler node
#prompt["3"]["inputs"]["seed"] = 5 #prompt["3"]["inputs"]["seed"] = 5
print(f"Running with seed: {args.seed}")
queue_prompt(prompt) queue_prompt(prompt)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment