Skip to content

Commit f4231a8

Browse files
authored
fix(Kling Image API Node): do not pass "image_type" when no image (Comfy-Org#9271)
* fix(Kling Image API Node): do not pass "image_type" when no image * fix(Kling Image API Node): raise client-side error when kling_v1 is used with reference image
1 parent 2208aa6 commit f4231a8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

comfy_api_nodes/nodes_kling.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,11 @@ async def api_call(
16901690
):
16911691
self.validate_prompt(prompt, negative_prompt)
16921692

1693-
if image is not None:
1693+
if image is None:
1694+
image_type = None
1695+
elif model_name == KlingImageGenModelName.kling_v1:
1696+
raise ValueError(f"The model {KlingImageGenModelName.kling_v1.value} does not support reference images.")
1697+
else:
16941698
image = tensor_to_base64_string(image)
16951699

16961700
initial_operation = SynchronousOperation(

0 commit comments

Comments
 (0)