CogView4 Wrapper
The local model that actually spells (and it does it in Chinese)
- image
This is the one-node way to run CogView4-6B locally in ComfyUI, and if you've ever been burned by a model that renders "COFFEE" as six letters of alphabet soup, you want to know what it is. CogView4 is Z.ai's (the Tsinghua KEG spinoff, formerly Zhipu AI) open-weights text-to-image model - Apache 2.0, 6 billion parameters - and its party trick is that it can write legible text in the image, in both English and Chinese, while still following long detailed prompts. The "Wrapper" part is exactly what it sounds like: chflame163's unofficial port that hides all the plumbing behind a single node.
The name is the honest part. It doesn't call an API, needs no key, and downloads nothing until your first run. It's also one of the rare ComfyUI image nodes where you don't wire up a checkpoint, a CLIP, and a VAE separately - there's just the prompt field, some settings, and one IMAGE output. Type, click, out pops a tensor you can send straight to a Save Image or a preview node.
Why you'd reach for it
CogView4's selling points, in order: bilingual prompt understanding (it's the first open text-to-image model to handle Chinese and English prompts natively, via a GLM-4 text encoder instead of the English-only T5), and genuinely good in-image text rendering. On the Dense Prompt Graph benchmark it scored 85.13 against Flux.1-dev's 83.79 with roughly half the parameters. So if your workflow needs a poster, a logo mockup, or a sign that reads what you typed - especially with Chinese characters - this is a real local alternative to Ideogram, and it's free weights rather than a subscription. It's not a photorealism king; it's the model you reach for when the words have to be right.
How it works
Under the hood the node wraps diffusers' CogView4Pipeline. On first run it snapshots the weights from Hugging Face into ComfyUI/models/CogView/CogView4-6B - and here's the gotcha most people miss: that's roughly 31 GB of downloads, because the repo ships the ~12.7 GB transformer, a ~17.6 GB GLM-4-9B text encoder, and a ~0.8 GB VAE, and the downloader grabs all of it. Then it loads the pipe in bf16 or fp32 and enables model CPU offload plus VAE slicing/tiling, which is how it squeezes onto a 16 GB card despite the text encoder being a 9B model. The README says "16GB or more," and that's true - but a lot of the weight lives in system RAM while it runs, so don't be shocked by the memory usage.
The inputs that matter
The rest are knobs you'll actually touch:
- dtype -
bf16is the sensible default;fp32doubles memory for basically no visible gain on this model. - guidance_scale (default 3.5) - there's no negative prompt field on this node, so this is your only steering wheel.
- width / height (default 1536x832) - CogView4 handles up to ~2048px natively, so unlike SD checkpoints you can go big without a latent upscale dance.
- cache_model (default true) - keeps the loaded pipeline in memory between runs so the second generation is fast; flip it off if you want the memory back.
Plus the usual seed, steps (30 default), batch_size, and the prompt itself. model only ever says "CogView4-6B" - there's just the one. The output is a single IMAGE tensor (batch images stacked), which wires into any preview or save node.
Installing it
ComfyUI Manager (search "CogView4 Wrapper") or the manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_CogView4_Wrapper
pip install -r ComfyUI_CogView4_Wrapper/requirements.txt
Then restart. Fair warning, straight from the README: the requirements install a dev build of diffusers from git plus a numpy<2.0 pin, and the author is explicit that this can break other plugins. Back up your environment before you let pip loose. Same author as the LayerStyle pack, so if you've been there, the house style should feel familiar. And skip the Baidu Netdisk mirror in the README - the Hugging Face auto-download is painless and the mirror just isn't needed outside China.
Common issues
First run looks hung - it isn't; it's downloading 31 GB. Out-of-memory on the default settings? Drop to bf16, and if it still OOMs, that's RAM, not VRAM: the offloaded text encoder eats system memory, so close the browser tabs. And if nodes start failing after install, the dev diffusers is your prime suspect - that's the known failure mode this pack ships with.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | 1 options: CogView4-6B | |
| dtype | COMBO | 2 options: bf16, fp32 | |
| prompt | STRING | A vibrant cherry red sports car sits proudly under the gleaming sun, its polished exterior smooth and flawless, casting a mirror-like reflection. The car features a low, aerodynamic body, angular headlights that gaze forward like predatory eyes, and a set of black, high-gloss racing rims that contrast starkly with the red. A subtle hint of chrome embellishes the grille and exhaust, while the tinted windows suggest a luxurious and private interior. The scene conveys a sense of speed and elegance, the car appearing as if it's about to burst into a sprint along a coastal road, with the ocean's azure waves crashing in the background.The license plate number of the car is 'CogView4'. The car sprinted along a coastal road, with the same sports car printed on the roadside billboard and large Chinese text '遥遥领先' written to it. The text was yellow, with thick strokes and heavy shadow lines. | — |
| seed | INT | 00–100000000000000 | — |
| guidance_scale | FLOAT | 3.50.1–100 | — |
| batch_size | INT | 11–100 | — |
| steps | INT | 301–100 | — |
| width | INT | 153616–4096 | — |
| height | INT | 83216–4096 | — |
| cache_model | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |