From 121f7bcec3aa2d42dedebb2ab47aaba0ba930c53 Mon Sep 17 00:00:00 2001 From: bigcat88 Date: Wed, 6 May 2026 09:39:33 +0300 Subject: [PATCH 1/2] feat(api-nodes): add grok-imagine-image-quality model Signed-off-by: bigcat88 --- comfy_api_nodes/nodes_grok.py | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/comfy_api_nodes/nodes_grok.py b/comfy_api_nodes/nodes_grok.py index f42d84616..5d49685b9 100644 --- a/comfy_api_nodes/nodes_grok.py +++ b/comfy_api_nodes/nodes_grok.py @@ -54,7 +54,12 @@ class GrokImageNode(IO.ComfyNode): inputs=[ IO.Combo.Input( "model", - options=["grok-imagine-image-pro", "grok-imagine-image", "grok-imagine-image-beta"], + options=[ + "grok-imagine-image-quality", + "grok-imagine-image-pro", + "grok-imagine-image", + "grok-imagine-image-beta", + ], ), IO.String.Input( "prompt", @@ -111,10 +116,12 @@ class GrokImageNode(IO.ComfyNode): ], is_api_node=True, price_badge=IO.PriceBadge( - depends_on=IO.PriceBadgeDepends(widgets=["model", "number_of_images"]), + depends_on=IO.PriceBadgeDepends(widgets=["model", "number_of_images", "resolution"]), expr=""" ( - $rate := $contains(widgets.model, "pro") ? 0.07 : 0.02; + $rate := widgets.model = "grok-imagine-image-quality" + ? (widgets.resolution = "1K" ? 0.04 : 0.05) + : ($contains(widgets.model, "pro") ? 0.07 : 0.02); {"type":"usd","usd": $rate * widgets.number_of_images} ) """, @@ -167,7 +174,12 @@ class GrokImageEditNode(IO.ComfyNode): inputs=[ IO.Combo.Input( "model", - options=["grok-imagine-image-pro", "grok-imagine-image", "grok-imagine-image-beta"], + options=[ + "grok-imagine-image-quality", + "grok-imagine-image-pro", + "grok-imagine-image", + "grok-imagine-image-beta", + ], ), IO.Image.Input("image", display_name="images"), IO.String.Input( @@ -228,11 +240,15 @@ class GrokImageEditNode(IO.ComfyNode): ], is_api_node=True, price_badge=IO.PriceBadge( - depends_on=IO.PriceBadgeDepends(widgets=["model", "number_of_images"]), + depends_on=IO.PriceBadgeDepends(widgets=["model", "number_of_images", "resolution"]), expr=""" ( - $rate := $contains(widgets.model, "pro") ? 0.07 : 0.02; - {"type":"usd","usd": 0.002 + $rate * widgets.number_of_images} + $isQualityModel := widgets.model = "grok-imagine-image-quality"; + $rate := $isQualityModel + ? (widgets.resolution = "1K" ? 0.04 : 0.05) + : ($contains(widgets.model, "pro") ? 0.07 : 0.02); + $base := $isQualityModel ? 0.01 : 0.002; + {"type":"usd","usd": $base + $rate * widgets.number_of_images} ) """, ), From 8bb647d53d7dad36b590664e526dd941fc166361 Mon Sep 17 00:00:00 2001 From: bigcat88 Date: Wed, 6 May 2026 13:00:02 +0300 Subject: [PATCH 2/2] fixed price badges Signed-off-by: bigcat88 --- comfy_api_nodes/nodes_grok.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/comfy_api_nodes/nodes_grok.py b/comfy_api_nodes/nodes_grok.py index 5d49685b9..9b4ba4808 100644 --- a/comfy_api_nodes/nodes_grok.py +++ b/comfy_api_nodes/nodes_grok.py @@ -120,7 +120,7 @@ class GrokImageNode(IO.ComfyNode): expr=""" ( $rate := widgets.model = "grok-imagine-image-quality" - ? (widgets.resolution = "1K" ? 0.04 : 0.05) + ? (widgets.resolution = "1k" ? 0.04 : 0.05) : ($contains(widgets.model, "pro") ? 0.07 : 0.02); {"type":"usd","usd": $rate * widgets.number_of_images} ) @@ -244,11 +244,15 @@ class GrokImageEditNode(IO.ComfyNode): expr=""" ( $isQualityModel := widgets.model = "grok-imagine-image-quality"; + $isPro := $contains(widgets.model, "pro"); $rate := $isQualityModel - ? (widgets.resolution = "1K" ? 0.04 : 0.05) - : ($contains(widgets.model, "pro") ? 0.07 : 0.02); + ? (widgets.resolution = "1k" ? 0.04 : 0.05) + : ($isPro ? 0.07 : 0.02); $base := $isQualityModel ? 0.01 : 0.002; - {"type":"usd","usd": $base + $rate * widgets.number_of_images} + $output := $rate * widgets.number_of_images; + $isPro + ? {"type":"usd","usd": $base + $output} + : {"type":"range_usd","min_usd": $base + $output, "max_usd": 3 * $base + $output} ) """, ),