ComfyUI Node

StyleRef Apply

The node that writes your style prompt for you

By StyleRef·Created 25 days ago·Updated 16 days ago· 4
StyleRef Apply
  • style
  • positive
  • negative
  • attribution
subject
targetdiffusion
extra_negative
compactfalse
sections
subject_firsttrue

Here's the whole pitch in one sentence: you load a style once, type "a rooftop at dusk" into StyleRef Apply, and out come two full prompt strings - positive and negative - phrased for exactly the model you're sampling. No more keeping your "look" in a spreadsheet and hoping you paste the right version. If you only add one node from the StyleRef pack to your graph, this is the one.

How it works

The detail that matters: StyleRef Apply does not write style prose itself. The compilation happens server-side on styleref.io, which means the style is phrased differently depending on your target - FLUX phrasing is not SDXL phrasing is not natural language. Apply just fetches the compiled spec and does the composition. The style text carries a slot, [YOUR SUBJECT/SCENE PROMPT HERE], and Apply substitutes your subject into it. When a style has no slot, your subject leads and the style follows - early tokens carry the most weight, so the subject is what survives truncation.

Compiled text is cached on the style object, so re-queueing after you change the subject doesn't hit the API again. It's a thin client, which cuts both ways: you need the service up, and the node fails with an error rather than degrading when it's not.

The inputs that matter

  • subject - what to depict. The style describes how it looks. Leave it empty to preview the style text on its own.
  • target - the one that bites you. flux for FLUX models, diffusion for SDXL/SD1.5/DALL·E-class. The other four (ai_tools, style_md, midjourney, json) exist for copying the output out of ComfyUI - the node warns if you feed one into a CLIP encoder, and you should believe it.
  • sections - compile only the style sections you list, comma-separated. Empty sends everything. More precise than compact when the style overwhelms the subject.
  • compact - a shorter spec. Reach for it when you're near the token limit.
  • extra_negative - your own negative terms, appended after the style's own guardrails.

The outputs

Three strings. positive wires into your positive CLIP Text Encode, negative into the negative one. attribution carries the style name, author, and link - put it in captions or metadata, never in the encoder. After a queue, Apply prints the composed prompt and a rough token estimate in its own node body; that's where you read what actually went to the sampler.

The traps

Which target you picked is the whole ballgame. Default is diffusion. If you're on FLUX, you want flux, and the templates in the pack assume FLUX.1 dev (the Comfy-Org fp8 all-in-one checkpoint, downloaded on first queue) or Z-Image Turbo.

SDXL truncates. A full compiled style runs long, and an SDXL CLIP encoder cuts off around 77 tokens - which is why the style washes out there no matter which checkpoint you use. There is no SDXL template set in the pack for exactly this reason. On SDXL, compact and sections aren't optional, they're survival gear.

FLUX and Z-Image don't take a negative prompt. Both are guidance-distilled at CFG 1.0, where the negative branch is multiplied out entirely. Apply still returns a negative string; if you need something from it, fold it into subject as a positive phrase. Raising CFG won't bring it back.

Style not biting hard enough? Two dials, in this order: push Flux guidance on the sampler from 3.5 to 4–5 (past that, colour goes poster-flat), or narrow sections to the identity-carrying ones - usually artistic_mediums,references,surface_material,colors for a period or painterly style, or shape_language and spatial_hierarchy for a geometric one.

Install

ComfyUI Manager - search StyleRef and click Install - or:

cd ComfyUI/custom_nodes
git clone https://github.com/StyleRef/styleref-comfyui

Restart, and confirm the console prints [StyleRef] v1.0.6 - 5 nodes registered. There are no Python dependencies - the pack imports on the standard library alone, which is a nice change from the usual custom-node dependency roulette. The one real dependency is styleref.io itself: every style is fetched from the API, so you need a working internet connection and the service up. Loaded styles are cached for the session, so a graph mid-run keeps working; a fresh load during an outage won't. STYLEREF_API repoints the client if you run your own instance. Nothing in this pack spends credits.

CategoryStyleRef

Inputs (7)

NameTypeDefaultDescription
styleSTYLEREF_STYLEFrom StyleRef Load.
subjectSTRINGWhat to depict — the style describes how it looks. Leave empty to preview the style text alone.
targetCOMBOdiffusionWhich format to compile — exactly the web app's copy list. For the sampler in this graph use flux, or diffusion for SDXL/SD1.5/DALL·E. ai_tools (ChatGPT & text LLMs), style_md (STYLE.md document), midjourney, and json are for copying out of ComfyUI.
extra_negativeoptSTRINGYour own additional negative terms, appended after the style's guardrails.
compactoptBOOLEANfalseShorter spec — use when the style overwhelms the subject or you are near the token limit.
sectionsoptSTRINGCompile only these style sections, comma-separated (e.g. colors,light_shadow,mood_personality) — empty = all. More precise than `compact` when the style overwhelms the subject.
subject_firstoptBOOLEANtrueOnly applies when the style has no built-in subject slot: put the subject before the style text. Most styles carry a slot, in which case this toggle does nothing.

Outputs (3)

NameTypeDescription
positiveSTRINGWire into your positive CLIP Text Encode.
negativeSTRINGWire into your negative CLIP Text Encode.
attributionSTRINGStyle name, author, and link — for captions or metadata, never the encoder.