ComfyUI Node

Lan-gpt-image-2

Advanced GPT image generation & editing node with custom API endpoint support. Use any OpenAI-compatible image API by setting base_url (e.g. http://localhost:8317/v1 for a local proxy). Supports text-to-image, image editing, inpainting, quality/size/format controls, retry logic, and more.

By Lan-0v0·Created 2 months ago·Updated 2 months ago· 1
Lan-gpt-image-2
  • image
  • mask
  • images
  • info
prompt
api_key
base_urlhttps://api.openai.com/v1
modelgpt-image-1
qualityauto
sizeauto
n1
backgroundopaque
moderationauto
auto_fallback_moderationtrue
output_formatpng
output_compression85
seed0
negative_prompt
timeout120
max_retries3
retry_delay2.0
extra_headers
save_to_diskfalse
output_dirlan_gpt_image_output
CategoryLan/gpt-image

Inputs (22)

NameTypeDefaultDescription
promptSTRINGText prompt describing the image to generate or the edit to apply.
api_keySTRINGAPI key. Leave blank to use the OPENAI_API_KEY environment variable.
base_urlSTRINGhttps://api.openai.com/v1API base URL. Use https://api.openai.com/v1 for official OpenAI, or a custom URL like http://localhost:8317/v1 for proxies.
modeloptSTRINGgpt-image-1Model name. Default: gpt-image-1. Change if your proxy/provider uses a different name.
qualityoptCOMBOautoImage quality. Affects cost and generation time.
sizeoptCOMBOautoOutput image dimensions.
noptINT11–10Number of images to generate per request.
backgroundoptCOMBOopaqueWhether the generated image has a transparent background.
moderationoptCOMBOautoContent moderation strictness. 'auto' = standard filtering, 'low' = less restrictive, 'none' = disable moderation (only works if the API/proxy supports it; enable auto_fallback_moderation to retry with 'low' if rejected).
auto_fallback_moderationoptBOOLEANtrueIf the API rejects the selected moderation level (e.g. 'none'), automatically retry with 'low' mode instead of failing.
output_formatoptCOMBOpngFormat of the returned image data from the API.
output_compressionoptINT850–100Compression level (0-100) for jpeg/webp output. Ignored for png.
seedoptINT00–18446744073709550000Random seed. May or may not be honoured by the API.
negative_promptoptSTRINGNegative prompt — describes what to avoid. (Sent only if the API supports it.)
imageoptIMAGEReference image for editing/inpainting. Connect with 'mask' to edit a specific area.
maskoptMASKInpainting mask. White (value > 0.5) = keep, black = edit area. Must be used with 'image'.
timeoutoptINT12010–600HTTP request timeout in seconds.
max_retriesoptINT30–10Maximum number of retry attempts on transient failures.
retry_delayoptFLOAT2.00–60Base delay in seconds between retries (exponential backoff applied).
extra_headersoptSTRINGAdditional HTTP headers as JSON, e.g. {"X-Custom-Header": "value"}. Useful for proxy auth.
save_to_diskoptBOOLEANfalseIf True, save generated images to output_dir.
output_diroptSTRINGlan_gpt_image_outputDirectory name for saved images. Created under ComfyUI output/ if relative.

Outputs (2)

NameTypeDescription
imagesIMAGE
infoSTRING