fix: custom comfyui prompt issue

This commit is contained in:
Timothy J. Baek 2024-10-11 13:11:17 -07:00
parent db35ea0ae1
commit 428fd202c5

View File

@ -125,22 +125,34 @@ async def comfyui_generate_image(
workflow[node_id]["inputs"][node.key] = model workflow[node_id]["inputs"][node.key] = model
elif node.type == "prompt": elif node.type == "prompt":
for node_id in node.node_ids: for node_id in node.node_ids:
workflow[node_id]["inputs"]["text"] = payload.prompt workflow[node_id]["inputs"][
node.key if node.key else "text"
] = payload.prompt
elif node.type == "negative_prompt": elif node.type == "negative_prompt":
for node_id in node.node_ids: for node_id in node.node_ids:
workflow[node_id]["inputs"]["text"] = payload.negative_prompt workflow[node_id]["inputs"][
node.key if node.key else "text"
] = payload.negative_prompt
elif node.type == "width": elif node.type == "width":
for node_id in node.node_ids: for node_id in node.node_ids:
workflow[node_id]["inputs"]["width"] = payload.width workflow[node_id]["inputs"][
node.key if node.key else "width"
] = payload.width
elif node.type == "height": elif node.type == "height":
for node_id in node.node_ids: for node_id in node.node_ids:
workflow[node_id]["inputs"]["height"] = payload.height workflow[node_id]["inputs"][
node.key if node.key else "height"
] = payload.height
elif node.type == "n": elif node.type == "n":
for node_id in node.node_ids: for node_id in node.node_ids:
workflow[node_id]["inputs"]["batch_size"] = payload.n workflow[node_id]["inputs"][
node.key if node.key else "batch_size"
] = payload.n
elif node.type == "steps": elif node.type == "steps":
for node_id in node.node_ids: for node_id in node.node_ids:
workflow[node_id]["inputs"]["steps"] = payload.steps workflow[node_id]["inputs"][
node.key if node.key else "steps"
] = payload.steps
elif node.type == "seed": elif node.type == "seed":
seed = ( seed = (
payload.seed payload.seed