π€ Leon GPT-Image API
GPT-Image 2 from a ComfyUI node β including real inpainting with a mask socket
- input_images_array
- mask_image
- image
- image_url
- seed
Leon GPT-Image API wraps OpenAI's image-generation line - gpt-image-2, gpt-image-1.5, gpt-image-1, and the cheap gpt-image-1-mini - and exposes it as a ComfyUI node routed through HyprLab. If you've seen the Ghibli-style viral waves and wondered what the actual API feels like, this is it: a prompt, a quality setting, a size, and OpenAI does the rest server-side.
What makes this node more interesting than the pack's other one-liner generation nodes is that it carries real editing features. There's a mask_image socket for inpainting (plus a mask_image_url if your mask is hosted), and a background switch - auto, transparent, opaque - that targets the GPT Image 1.x models' native transparency handling. That's a capability most hosted-image wrappers skip, and it's the reason you'd pick this node over, say, the Imagen one for anything that isn't a straight text-to-image.
How it works
Standard pack machinery: the node POSTs a JSON payload to https://api.hyprlab.io/v1/images/generations with a Bearer token, the shared base class retries up to 5 times on failure, downloads the result, and returns an RGBA tensor plus the image URL and seed.
Inputs worth your attention:
model-gpt-image-2is the default and the current flagship;-miniis the budget tier.quality-high/medium/low.size- a real menu here:auto,1024x1024,1536x1024,1024x1536, and big ones up to2048x2048and3840x2160. GPT-Image is one of the few hosted lines that'll do 4K-ish output.input_images_array- optional multiple input images (chain the pack's Image Array Builder).mask_image/mask_image_url- for inpainting. Give it an image and a mask and the prompt describes what fills the mask.background-auto/transparent/opaque, only honored by the 1.x models (tooltip says so).input_fidelity-low/high, for the 1.5 and 1 models.
Outputs: image, image_url, seed.
Installing it
Same pack, same install:
cd ComfyUI/custom_nodes
git clone https://github.com/l3ony2k/comfyui-leon-nodes
pip install -r requirements.txt
Restart ComfyUI or install "ComfyUI Leon Nodes" via ComfyUI Manager. No model files, minimal dependencies.
Where people get burned
OpenAI's guardrails are the elephant here. The GPT Image stack's content filters have a long and very public history of being aggressive and inconsistent - "trips its baby mode content filters" is basically a meme - and that behavior comes along with the API. A refusal isn't a node bug. Second, model-specific parameters: background and input_fidelity do nothing on gpt-image-2, so don't chase them there. Third, the retry backoff means a bad HyprLab key fails slowly, not fast - the placeholder YOUR_HYPRLAB_API_KEY is the usual culprit. And as with the rest of this pack's API nodes, HyprLab is a small aggregator with thin public documentation, so expect to read provider docs when something's off. Inpainting with an actual mask socket is the feature that makes this worth having alongside the generation-only nodes.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | gpt-image-2 | 4 options: gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini |
| prompt | STRING | A cute cat. | Text description of the image to generate |
| quality | COMBO | medium | Image generation quality |
| size | COMBO | 1024x1024 | Size of the generated image |
| response_format | COMBO | url | Format of the response |
| output_format | COMBO | png | Output image format |
| seed | INT | 00β18446744073709550000 | Random seed for reproducible results |
| api_url | STRING | https://api.hyprlab.io/v1/images/generations | API URL |
| api_key | STRING | YOUR_HYPRLAB_API_KEY | Your HyprLab API key |
| input_images_arrayopt | IMAGE_ARRAY | Optional multiple input images. Connect Image Array Builder node output here. | |
| mask_imageopt | IMAGE | Optional mask image for inpainting | |
| mask_image_urlopt | STRING | Optional mask image URL for inpainting | |
| backgroundopt | COMBO | auto | Background setting (for gpt-image-1.5, gpt-image-1, gpt-image-1-mini) |
| input_fidelityopt | COMBO | low | Input fidelity setting (for gpt-image-1.5, gpt-image-1) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| image_url | STRING | β |
| seed | INT | β |