Qwen3.5: Text Generation

This workflow demonstrates how to use Qwen3.5 inside ComfyUI to analyze an image and generate descriptive text that doubles as ready-to-use prompts. It performs both image captioning and reverse prompt engineering: you provide an image via LoadImage, and the TextGenerate node, powered by Qwen3.5, returns structured descriptions or prompt candidates you can paste into your image-generation pipelines.

Technically, the CLIPLoader node is pointed at the Qwen3.5 weights (qwen3.5_4b_bf16.safetensors) stored under models/text_encoders/. That model handle feeds into the TextGenerate node, which accepts the loaded image and an instruction prompt (for example, "Produce 3 concise, diffusion-ready prompts"). The node then runs inference and returns text, which you can view with PreviewAny. A MarkdownNote in the graph provides inline guidance and prompt tips, making it easy to iterate on instruction wording, temperature, and token length to dial in results.

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.

llm_qwen3_5_text_gen.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 this workflow (TypeScript)
import { Comfy } from "@comfyorg/sdk";

const client = new Comfy({ apiKey: "comfyui-..." });
const wf = await client.workflows.fromFile("workflow_api.json");
const job = await client.run(wf);
await job.getOutputs("<output-node-id>")[0].toFile("output.png");

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