ComfyUI — Prompting

Clean, weighted, and effective prompts

Principles (short)

  • Be specific: subject, style, camera/light, mood.
  • Avoid contradictions (don’t ask for “no blur + motion blur”).
  • Use weights to emphasize/de-emphasize instead of long adjectives.
  • Keep prompts clean: trim extra spaces, consistent commas.

Weights and grouping

  • (term) emphasizes, [term] de-emphasizes.
  • (term:1.2) numeric weight; typical range 0.5–1.5.
  • Multiple parentheses stack: (((term))) ≈ stronger than (term).
  • Quotes group phrases for clarity: "cinematic lighting", "volumetric fog".
# Positive
masterpiece, portrait, (cinematic lighting:1.2), "soft rim light", [blurry:0.5], 85mm, f/1.8

# Negative
worst quality, lowres, (jpeg artifacts:1.3), blurry, extra fingers

Note: Stock ComfyUI supports weighted tokens in CLIPTextEncode; inline LoRA tags like <lora:name:0.8> require nodes or community parsers.

Positive vs Negative in ComfyUI

  • Use two CLIPTextEncode nodes: one for positive, one for negative.
  • Wire them to the sampler’s conditioning and negative_conditioning inputs.
  • Keep negatives short and targeted (artifacts, anatomy issues, low quality).

Whitespace and cleanup

Normalize spacing so changes are easy to diff and reuse.

# Simple Python helper (optional)
import re

def clean_prompt(s: str) -> str:
    s = s.strip()
    s = re.sub(r"\s*,\s*", ", ", s)  # tidy commas
    s = re.sub(r"\s+", " ", s)        # collapse spaces
    s = re.sub(r",\s*$", "", s)       # no trailing comma
    return s

print(clean_prompt("  portrait,  (cinematic:1.2) ,  85mm  "))

Quick recipes

# Portrait (SDXL)
masterpiece, ultra-detailed, 85mm photo, (soft lighting:1.15), "studio backdrop", skin texture
NEG: lowres, jpeg artifacts, overexposed, [film grain:0.5]

# Stylized anime (Pony)
masterpiece, "full body character", dynamic pose, (clean lineart:1.2), saturated colors
NEG: messy lines, extra limbs, nsfw, blurry

# Product shot
product studio shot, centered, (three-point lighting:1.2), "white seamless background", reflections
NEG: scratches, fingerprints, dust, harsh shadows

Notes

  • Match prompt complexity to model: SDXL handles longer, specific prompts well.
  • Use LoRA nodes for styles/subjects; adjust UNet/CLIP weights.
  • Iterate: change one thing at a time; save prompt versions.