Qwen-Image InstantX Inpainting ControlNet - After
Qwen-Image InstantX Inpainting ControlNet - Before

The Qwen-Image InstantX Inpainting ControlNet workflow is a powerful tool for professional image editing, specifically designed for tasks such as object replacement, text modification, background changes, and outpainting. At its core, the workflow utilizes the Qwen-Image model, which is renowned for its high-quality inpainting capabilities. The workflow integrates several nodes, including KSampler, CLIPTextEncode, and ControlNetInpaintingAliMamaApply, to facilitate detailed and precise image manipulations.

Technically, the workflow begins with uploading the necessary models and the image to be edited. Users can then define the areas for inpainting using the MaskEditor, which is accessed via the LoadImage node. The workflow employs the VAELoader and UNETLoader nodes to encode and decode images, ensuring that the edits blend seamlessly with the original image. The ControlNetLoader and ControlNetInpaintingAliMamaApply nodes are pivotal in applying the inpainting effects, allowing for intricate modifications while maintaining the image's overall coherence. This workflow is particularly useful for creative professionals seeking to enhance or alter images with precision and ease.

API

Use this workflow from code

Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.

image_qwen_image_instantx_inpainting_controlnet.json
Fetching workflow JSON…

Run it from TypeScript or Python with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.

// Install (beta)
npm i @comfyorg/sdk

// Run "Qwen-Image InstantX Inpainting ControlNet" (TypeScript)
import { Comfy } from "@comfyorg/sdk";

const client = new Comfy({ apiKey: "comfyui-..." });

// This workflow, exported in API format (see note below)
const wf = await client.workflows.fromFile("image_qwen_image_instantx_inpainting_controlnet_api.json");

const asset = client.assets.fromFile("input.png");
wf.setInput("71", "image", asset); // LoadImage

wf.setInput("6", "text", "The Queen, on a throne, surrounded by Knights, HD, Realistic, Octane Render, Unreal engine"); // CLIPTextEncode

const job = await client.run(wf);
await job.getOutputs("189")[0].toFile("output.png"); // SaveImage

The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API).

Comfy Cloud API access requires a plan with an API key.

FAQ

Frequently Asked Questions

View all workflows
Showing 30 of 30 templates