Nodes/Leon's Utility and API Integration Nodes/πŸ€– Leon GPT-Image API
ComfyUI Node

πŸ€– Leon GPT-Image API

GPT-Image 2 from a ComfyUI node β€” including real inpainting with a mask socket

By l3ony2kΒ·Created about a year agoΒ·Updated 2 months agoΒ· 3
πŸ€– Leon GPT-Image API
  • input_images_array
  • mask_image
  • image
  • image_url
  • seed
β—„modelgpt-image-2β–Ί
β—„promptA cute cat.β–Ί
β—„qualitymediumβ–Ί
β—„size1024x1024β–Ί
β—„response_formaturlβ–Ί
β—„output_formatpngβ–Ί
β—„seed0β–Ί
β—„api_urlhttps://api.hyprlab.io/v1/images/generationsβ–Ί
β—„api_keyYOUR_HYPRLAB_API_KEYβ–Ί
β—„mask_image_urlβ–Ί
β—„backgroundautoβ–Ί
β—„input_fidelitylowβ–Ί

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-2 is the default and the current flagship; -mini is the budget tier.
  • quality - high / medium / low.
  • size - a real menu here: auto, 1024x1024, 1536x1024, 1024x1536, and big ones up to 2048x2048 and 3840x2160. 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.

CategoryLeon_API

Inputs (14)

NameTypeDefaultDescription
modelCOMBOgpt-image-24 options: gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini
promptSTRINGA cute cat.Text description of the image to generate
qualityCOMBOmediumImage generation quality
sizeCOMBO1024x1024Size of the generated image
response_formatCOMBOurlFormat of the response
output_formatCOMBOpngOutput image format
seedINT00–18446744073709550000Random seed for reproducible results
api_urlSTRINGhttps://api.hyprlab.io/v1/images/generationsAPI URL
api_keySTRINGYOUR_HYPRLAB_API_KEYYour HyprLab API key
input_images_arrayoptIMAGE_ARRAYOptional multiple input images. Connect Image Array Builder node output here.
mask_imageoptIMAGEOptional mask image for inpainting
mask_image_urloptSTRINGOptional mask image URL for inpainting
backgroundoptCOMBOautoBackground setting (for gpt-image-1.5, gpt-image-1, gpt-image-1-mini)
input_fidelityoptCOMBOlowInput fidelity setting (for gpt-image-1.5, gpt-image-1)

Outputs (3)

NameTypeDescription
imageIMAGEβ€”
image_urlSTRINGβ€”
seedINTβ€”