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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Text prompt describing the image to generate or the edit to apply. | |
| api_key | STRING | API key. Leave blank to use the OPENAI_API_KEY environment variable. | |
| base_url | STRING | https://api.openai.com/v1 | API base URL. Use https://api.openai.com/v1 for official OpenAI, or a custom URL like http://localhost:8317/v1 for proxies. |
| modelopt | STRING | gpt-image-1 | Model name. Default: gpt-image-1. Change if your proxy/provider uses a different name. |
| qualityopt | COMBO | auto | Image quality. Affects cost and generation time. |
| sizeopt | COMBO | auto | Output image dimensions. |
| nopt | INT | 11–10 | Number of images to generate per request. |
| backgroundopt | COMBO | opaque | Whether the generated image has a transparent background. |
| moderationopt | COMBO | auto | Content 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_moderationopt | BOOLEAN | true | If the API rejects the selected moderation level (e.g. 'none'), automatically retry with 'low' mode instead of failing. |
| output_formatopt | COMBO | png | Format of the returned image data from the API. |
| output_compressionopt | INT | 850–100 | Compression level (0-100) for jpeg/webp output. Ignored for png. |
| seedopt | INT | 00–18446744073709550000 | Random seed. May or may not be honoured by the API. |
| negative_promptopt | STRING | Negative prompt — describes what to avoid. (Sent only if the API supports it.) | |
| imageopt | IMAGE | Reference image for editing/inpainting. Connect with 'mask' to edit a specific area. | |
| maskopt | MASK | Inpainting mask. White (value > 0.5) = keep, black = edit area. Must be used with 'image'. | |
| timeoutopt | INT | 12010–600 | HTTP request timeout in seconds. |
| max_retriesopt | INT | 30–10 | Maximum number of retry attempts on transient failures. |
| retry_delayopt | FLOAT | 2.00–60 | Base delay in seconds between retries (exponential backoff applied). |
| extra_headersopt | STRING | Additional HTTP headers as JSON, e.g. {"X-Custom-Header": "value"}. Useful for proxy auth. | |
| save_to_diskopt | BOOLEAN | false | If True, save generated images to output_dir. |
| output_diropt | STRING | lan_gpt_image_output | Directory name for saved images. Created under ComfyUI output/ if relative. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| info | STRING | — |