Sign In

A ComfyUI workflow with Style Grid

3

A ComfyUI workflow with Style Grid

This guide builds a plain txt2img workflow in ComfyUI with the Style Grid node at the front, so you can pick styles from a panel and leave the graph alone. It's the setup to start from if you're new to Style Grid in ComfyUI, and it's short enough to build by hand in a couple of minutes.

If you haven't installed the node yet, the complete guide covers that.

What the Style Grid node does in a graph

It's a prompt source. It has two text fields, text and negative_text, and two STRING outputs, positive and negative. Styles you click in the panel are written into those fields. When the workflow runs, the node resolves any wildcards and sends the finished strings on.

It doesn't encode anything and it doesn't touch the model. That's why it fits into any workflow: wherever you have a text encoder, you can feed it from Style Grid.

The nodes

  1. Load Checkpoint

  2. Style Grid

  3. CLIP Text Encode, twice: one for positive, one for negative

  4. Empty Latent Image

  5. KSampler

  6. VAE Decode

  7. Save Image

If you load ComfyUI's default workflow, everything except Style Grid is already there. Add the Style Grid node from the node search and you only have two wires to connect.

Wiring

Drag the positive output of Style Grid onto the text box of the positive CLIP Text Encode node. Dropping a STRING output on a text box turns the box into an input. Do the same with negative and the negative encoder.

node-wiring.png

The rest is the standard chain:

  • Load Checkpoint CLIP goes to both text encoders.

  • Load Checkpoint MODEL goes to the KSampler.

  • The two encoders go to the KSampler's positive and negative.

  • Empty Latent Image goes to the KSampler's latent_image.

  • KSampler goes to VAE Decode, together with the checkpoint's VAE.

  • VAE Decode goes to Save Image.

Settings to start with

Use whatever your checkpoint wants. As a reference, my own NoobAI workflow runs the first pass at 896 x 1152, 30 steps, CFG 4, sampler euler, scheduler sgm_uniform.

Write the prompt

Type your character into the Style Grid node's text field. Then click Browse Styles and pick the rest from the panel:

  1. the quality style for your model from BASE,

  2. a camera or framing style,

  3. clothes,

  4. a scene,

  5. a lighting style.

Each click adds the style's tags to text and its negative to negative_text. Close the panel and the node shows a chip for every style that's applied.

node-chips.png

The ✕ on a chip removes that style without opening the panel, and Ctrl+Z undoes it.

Two seeds, two jobs

This workflow has two seed fields, and they do different things.

  • The KSampler seed controls the image noise.

  • The Style Grid seed controls which style a random wildcard ({sg:…}) picks.

That split is useful. Fix the KSampler seed and leave the Style Grid seed on randomize to see different styles on the same composition. Do the opposite to see different compositions of the same style pick.

If your prompt has no wildcards, the Style Grid seed has no effect.

The same thing in a bigger workflow

This is the Style Grid node in one of my own workflows. It has an upscale pass, detailers and an image saver, and the wiring of the node is no different: positive and negative go to the two text encoders, and everything after that reads the prompt from them.

real-workflow.jpg

A Style Grid node with a shuffle wildcard in a larger workflow. The chip under the seed shows the active wildcard.

Adding a hires pass

The same two encoders can feed a second sampler. A common way to add a hires pass:

  1. Decode the first pass and upscale the image with an upscale model (Load Upscale Model and Upscale Image (using Model)), then scale it to the size you want.

  2. Encode it back with VAE Encode.

  3. Feed that into a second KSampler with the same model, the same positive and negative, and a low denoise. Mine runs 15 steps at denoise 0.3.

  4. Send the second KSampler to VAE Decode.

Because both samplers read the prompt from the same Style Grid node, a wildcard resolves once per run and both passes get the same style.

More than one Style Grid node

You can have several Style Grid nodes in one workflow, for example one per character in a regional setup or one per pass. Each keeps its own text, chips and seed. Clicking a chip or Browse Styles opens the panel for that node.

Saving and sharing

Applied styles are stored in the workflow. When you load it later, the chips show what was picked. If you share the workflow with someone who doesn't have the same style pack, the text in the node still works, because the tags are already written out. They just won't be able to browse your styles.

If your styles use BREAK

The built-in CLIP Text Encode reads BREAK as a normal word. Swap it for an encoder that understands it, such as CLIPTextEncodeBREAK from ComfyUI-ppm. The Style Grid outputs connect the same way.

Next

Once this runs, try a shuffle wildcard and queue a few runs. There's a separate guide for that: Shuffle wildcards in the ComfyUI queue.

More guides are on my profile.

3

Comments