Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.comfy.org/llms.txt

Use this file to discover all available pages before exploring further.

This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub
The Grok Image node generates one or more images based on a text description using the Grok AI model. It sends your prompt to an external service and returns the generated images as tensors that can be used in your workflow.

Inputs

ParameterData TypeRequiredRangeDescription
modelCOMBOYes"grok-imagine-image-quality"
"grok-imagine-image-pro"
"grok-imagine-image"
"grok-imagine-image-beta"
The specific Grok model to use for image generation. Different models may offer varying quality, speed, or features.
promptSTRINGYesN/AThe text prompt used to generate the image. This description guides the AI on what to create. Must be at least 1 character long.
aspect_ratioCOMBOYes"1:1"
"2:3"
"3:2"
"3:4"
"4:3"
"9:16"
"16:9"
"9:19.5"
"19.5:9"
"9:20"
"20:9"
"1:2"
"2:1"
The desired width-to-height ratio for the generated image.
number_of_imagesINTNo1 to 10Number of images to generate (default: 1).
seedINTNo0 to 2147483647A seed value to determine if the node should re-run. The actual image results are nondeterministic and will vary even with the same seed (default: 0).
resolutionCOMBONo"1K"
"2K"
The desired output resolution for the generated images (default: “1K”).
Note: The seed parameter is primarily used to control when the node re-executes within a workflow. Due to the nature of the external AI service, the generated images will not be reproducible or identical across runs, even with an identical seed. Note on pricing: The cost of generating images depends on the selected model, resolution, and number_of_images. For example, the “grok-imagine-image-quality” model with “1K” resolution costs 0.05perimage,while"2K"resolutioncosts0.05 per image, while "2K" resolution costs 0.07 per image. The “grok-imagine-image-pro” model costs 0.07perimage,andothermodelscost0.07 per image, and other models cost 0.02 per image.

Outputs

Output NameData TypeDescription
outputIMAGEThe generated image or a batch of images. If number_of_images is 1, a single image tensor is returned. If greater than 1, a batch of image tensors is returned.

Source fingerprint (SHA-256): f4af858c6b94fd74be1856849417609f3d45fc0f139e8f2e56cdabb6e3521076