ComfyUI Integration

Use your own computer's AI for image generation

Overview

ComfyUI is a free tool that lets you run AI image generation on your own computer. By connecting ComfyUI to Genko Comic, you can use your own custom setups for creating images, editing them, and more — all using your computer's graphics card.

ComfyUI must be installed and running on your computer before you can use it with Genko Comic. Genko talks to ComfyUI over your local network.

What You Need

  • Latest comfyUI installed and running on your computer (see ComfyUI on GitHub or ComfyUI Easy Installer )
  • Python 3.x and a graphics card (NVIDIA recommended)
  • A ComfyUI workflow saved in API Format (.json file)

Step 1: Run ComfyUI with CORS

Genko Comic runs in your web browser on a different address than ComfyUI. By default, ComfyUI blocks requests from other addresses. You need to tell ComfyUI to allow requests from Genko Comic.

Why is this needed? Web browsers have a security feature that blocks websites from talking to other servers unless those servers say it's okay. Since Genko Comic runs on https://genkomik.com and ComfyUI runs on http://localhost:8188, ComfyUI needs to be told to accept requests from Genko.

Start ComfyUI with the --enable-cors-header setting:

python main.py --enable-cors-header "*"
ℹ️ About the Setting
The "*" value allows requests from any address. For tighter security, you can use your Genko Comic address instead, like --enable-cors-header "https://genkomik.com".

If you use the ComfyUI Manager or a launcher, look for an option to add extra settings and add --enable-cors-header "*" there.

ComfyUI terminal showing CORS flag enabled

Step 2: Turn On Developer Mode

To save workflows in the format Genko Comic needs, you must turn on Developer Mode in ComfyUI:

  1. Open ComfyUI in your browser (default: http://localhost:8188).
  2. Click the gear icon (Settings) in the top-right corner.
  3. Find and turn on the "Dev Mode" switch.
  4. Close settings. You will now see a "Save (API Format)" option in the menu.
ComfyUI settings panel with Dev Mode toggle
Without Developer Mode on, the "Save (API Format)" button won't show up. Genko Comic needs the API Format save, not the regular workflow save.

Step 3: Save Your Workflow as API JSON

Genko Comic needs your workflow saved in API Format. This is different from the regular workflow save.

  1. Build your workflow in ComfyUI.
  2. Click the menu icon (three lines) in the top-right.
  3. Select "Save (API Format)". This downloads a .json file.
  4. Repeat for each workflow type you need (Generate, Edit, Mask).
You may need separate workflows for each purpose (creating, editing, masking), or one workflow might work for multiple purposes if it has the right setup.
ComfyUI menu showing Save API Format option

Step 4: Required Parts by Workflow Type

Genko Comic checks your uploaded workflow file for specific parts. What's needed depends on which workflow type you're uploading. Each workflow type is uploaded separately in the Genko AI Dashboard.

Generate Image Workflow

Used for creating images from text. This is the simplest workflow.

What you need:

  • SaveImage — A part with class_type: "SaveImage". This is where generated images are saved.
  • {GENKO_POSITIVE_PROMPT} — A part (usually a CLIPTextEncode or similar) whose settings contain the text "{GENKO_POSITIVE_PROMPT}". Genko Comic will replace this with your prompt.
Generate workflow showing SaveImage node CLIPTextEncode node with {GENKO_POSITIVE_PROMPT} placeholder

Extra mask requirements:

  • Your workflow must have a LoadImage part titled "GENKO_IMAGE_1" with its mask output connected to any other part. In ComfyUI, this is shown as an input array [nodeId, 1] — meaning "take output slot 1 from another part." Genko detects these connections automatically.
  • Usually, you connect the LoadImage part's output to an ImageToMask part (to extract the transparent area as a mask), then connect that mask output to your editing or SetLatentNoiseMask part.
💡 How to Set Up
Build a mask-based workflow in ComfyUI. Add a LoadImage part and title it "GENKO_IMAGE_1". Connect its output to an ImageToMask part, then connect the mask output (slot 1) to your editing part's mask input. Genko will inject the source image and mask automatically.
Mask workflow showing GENKO_IMAGE_1 LoadImage node connected to ImageToMask

Parts Naming Summary

Part NameWhat It DoesNeeded For
SaveImageOutput partAll types
{GENKO_POSITIVE_PROMPT}Your prompt goes hereAll types
{GENKO_NEGATIVE_PROMPT}Things to avoid go hereOptional (all types)
GENKO_IMAGE_1LoadImage part for input imageEdit, Mask
GENKO_IMAGE_2+Additional input imagesOptional (Edit, Mask)

Step 5: Set Up in Genko

Now connect ComfyUI to Genko Comic:

  1. Go to the AI Dashboard at user dashboard .
  2. Click the ComfyUI Setting tab.
  3. Turn ComfyUI Integration ON.
  4. Enter your ComfyUI address (default: http://localhost:8188) and click Save.
  5. Wait for the status to show Connected (green dot).
  6. If your ComfyUI uses a password, enter the API Key (optional).
  7. Under Generate Image Workflow, click Upload JSON and pick your generate workflow file.
  8. Repeat for Image Edit Workflow and Mask Edit Workflow.
  9. Pick the uploaded workflow from the dropdown for each type.
Genko AI Dashboard with ComfyUI settings configured
You can upload multiple workflows for each type and switch between them using the dropdown.

Troubleshooting

ℹ️ Connection Problems
  • If the status says Disconnected, make sure ComfyUI is running and the address is correct.
  • Check that CORS is turned on — make sure you started ComfyUI with --enable-cors-header "*".
ℹ️ Workflow Upload Errors
  • "SaveImage node not found" — Your workflow doesn't have a SaveImage part. Add one in ComfyUI.
  • "{GENKO_POSITIVE_PROMPT} not found" — No part has the {GENKO_POSITIVE_PROMPT} text. Add it to your prompt part's text field.
  • "GENKO_IMAGE_1 not found" — For Edit/Mask workflows, you need a LoadImage part titled "GENKO_IMAGE_1".
  • Make sure you saved using "Save (API Format)", not the regular save.
⚠️ Developer Mode Not Showing
If you don't see "Save (API Format)" in the menu, Developer Mode is not turned on. Go to Settings (gear icon) and turn Dev Mode on.