Skip to main content

Overview

Comfyui-Luck-gpt2.0 is a ComfyUI custom node pack contributed by community user luckdvr. It lets you call APIYI’s two GPT image models directly inside ComfyUI — official gpt-image-2 and reverse-engineered gpt-image-2-all. The two nodes divide work clearly: the former focuses on fine-grained parameters (resolution, quality, mask, multi-reference), while the latter delivers the ChatGPT-parity conversational image experience, with built-in timeout/retry — ideal for production workflows.
Project Info
  • 🔗 Source: github.com/luckdvr/Comfyui-Luck-gpt2.0
  • 📜 License: Apache-2.0
  • 👤 Author: luckdvr
  • ⭐ Community contribution, built for APIYI
How to tell this apart from the author’s other node pack?luckdvr contributes two ComfyUI node packs for APIYI:
  • Luck Nano Banana Pro: calls the Gemini line (gemini-3-pro-image-preview / gemini-3.1-flash-image-preview) — emphasizes 14 reference images and engineering-grade retry/timeout
  • Luck GPT-Image 2 (this page): calls the OpenAI line (gpt-image-2 / gpt-image-2-all) — emphasizes dual-endpoint switching (chat_completions / images_api) and mask inpainting

Core Features

Two nodes, two routes

Comfyui-Luck gpt-image-2 (official) and Comfyui-Luck gpt-2.0 all (reverse) — pick whichever fits the scene

Up to 5 reference images

The official node accepts up to 5 reference images for complex fusion and style transfer

Mask inpainting

Optional mask input to precisely target the edit region for local changes

Multi-tier + custom resolution

1K / 2K / 4K presets plus custom sizing (max 3840px per edge, 655,360–8,294,400 total pixels)

15 aspect ratios

AUTO, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1

Quality & output format

quality (auto / low / medium / high) + output format (png / jpeg / webp) + compression 0-100

Dual endpoints (reverse node)

gpt-image-2-all supports switching between chat_completions and images_api endpoints

Built-in timeout & retry

Timeout and retry parameters built in — stable even at peak hours

Supported APIYI Models

ModelModel IDNodeUseAPI Docs
GPT-Image 2 (official)gpt-image-2Comfyui-Luck gpt-image-2Native 2K/4K text-to-image, reference-image editing, mask inpaintingView
GPT-Image 2 All (reverse)gpt-image-2-allComfyui-Luck gpt-2.0 allChatGPT-parity conversational image generation, per-call billingView

Node Parameters

Comfyui-Luck gpt-image-2 (official)

ParameterTypeRequiredDefaultDescription
api_keystringYes-APIYI token — we recommend a dedicated key with a usage cap
promptstringYes-Generation or editing instruction
image_1image_5IMAGENo-Reference images, up to 5
maskMASKNo-Optional mask for inpainting (white area = edit region)
sizeenumNo2KOutput resolution (1K / 2K / 4K / custom)
custom_sizestringNo-Used when size is custom, e.g. 2048x3072
aspect_ratioenumNoAUTOOne of 15 aspect ratios
qualityenumNoautoauto / low / medium / high
output_formatenumNopngpng / jpeg / webp
output_compressionintNo800-100 (applies to jpeg / webp only)

Comfyui-Luck gpt-2.0 all (reverse)

ParameterTypeRequiredDefaultDescription
api_keystringYes-APIYI token
promptstringYes-Conversational image prompt
endpointenumNochat_completionschat_completions / images_api
response_formatenumNo-b64_json / url etc.
timeout_secondsintNo-Per-request timeout
retry_timesintNo-Retry count on failure

Installation

1

Step 1: Clone into custom_nodes

Inside your ComfyUI install:
cd ComfyUI/custom_nodes
git clone https://github.com/luckdvr/Comfyui-Luck-gpt2.0.git
2

Step 2: Install dependencies

cd Comfyui-Luck-gpt2.0
python3 -m pip install -r requirements.txt
3

Step 3: Restart ComfyUI

Search Luck gpt-image-2 or Luck gpt-2.0 all in the node palette to find them.
4

Step 4: Configure APIYI key

  • Visit APIYI Console → Tokens, create a new key (use a usage cap for safety)
  • Paste it into the api_key field
  • The node defaults to api.apiyi.com; you can switch to backup domains vip.apiyi.com / b.apiyi.com if needed
5

Step 5: Import the example workflow

The repo ships with example_workflow.json — import it into ComfyUI as a starting point.

Usage Examples

Example 1: Official 4K high-quality text-to-image

Node: Comfyui-Luck gpt-image-2
prompt: "Cinematic portrait of a samurai in a misty bamboo forest, volumetric light, 85mm lens, photorealistic"
size: 4K
aspect_ratio: 2:3
quality: high
output_format: png

Example 2: Mask inpainting (official)

Node: Comfyui-Luck gpt-image-2
image_1: original photo
mask: the area to be replaced (white = edit region)
prompt: "replace the sky with dramatic sunset clouds, keep everything else intact"
size: 2K
quality: high

Example 3: Reverse conversational image

Node: Comfyui-Luck gpt-2.0 all
endpoint: chat_completions
prompt: "A girl in hanfu standing under a cherry blossom tree, watercolor style, soft lighting"
response_format: b64_json
timeout_seconds: 180
retry_times: 3

FAQ

  • gpt-image-2 (official): controllable parameters, native mask support, per-token billing, fine-grained resolution/quality — best when you have specific size requirements or need local edits
  • gpt-image-2-all (reverse): per-call billing ($0.03/call), conversational natural-language prompts, parity with the ChatGPT web experience — best for iterative edits and strong text rendering
  • Full side-by-side: official vs reverse comparison
  1. Confirm the folder sits at ComfyUI/custom_nodes/Comfyui-Luck-gpt2.0
  2. pip install -r requirements.txt completed without errors
  3. Fully restart ComfyUI (refreshing the frontend alone is not enough)
  • Raise timeout_seconds on the reverse node
  • If your server network is slow, see CDN image/video downloads are slow
  • Switch to backup domains vip.apiyi.com / b.apiyi.com if the default endpoint is flaky
The reverse gpt-image-2-all returns b64_json with a data:image/png;base64, prefix, while the official gpt-image-2 does not. Details in the official vs reverse comparison.
  1. Check api_key validity and whether it’s restricted by channel
  2. Make sure the selected model is whitelisted on the token
  3. Balance issues — see Balance seems enough but calls fail

gpt-image-2 (official) docs

Native 2K/4K generation, per-token billing

gpt-image-2-all (reverse) docs

ChatGPT parity, $0.03 per call

Official vs Reverse comparison

17-dimension side-by-side table

ComfyUI node collection

Browse more APIYI-adapted ComfyUI nodes

Luck Nano Banana Pro (same author)

luckdvr’s Gemini-line ComfyUI node

APIYI GPT-Image 2 Skills (same models)

AI Agent Skill flavor for the same two GPT image models

APIYI Console

Manage keys, usage, and channels