Skip to main content

Primitive

Welcome to the chameleon of ComfyUI — the Primitive node. This deceptively simple utility node is one of those behind-the-scenes MVPs of any modular workflow. Think of it like a universal plug: it adapts to what you connect it to, giving you the power to reuse and centralize parameters across your graph.

Whether you’re tired of hardcoding duplicate seeds across 4 KSamplers or you just want to propagate a consistent string or float through multiple branches of your workflow — the Primitive node’s got your back.

🧠 What This Node Does

The Primitive node automatically adjusts its input field depending on the type of data it’s connected to. It’s a type-aware parameter node that can output a string or number (float or int), depending on how and where it’s used.

This allows it to act as a shared parameter across multiple nodes — without duplicating values manually — making your workflow more modular, DRY (Don't Repeat Yourself), and infinitely more Comfy.

🧩 Node Type

  • Category: Core Utility
  • Node Class: Primitive
  • Inputs: None (manual entry only)
  • Outputs: Type-dependent (dynamic, based on connection)
  • Tags: Parameter Control, Type-Aware, Value Sharing

🔌 Inputs

None.
You don’t plug anything into a Primitive node — you configure its value manually in the UI and wire it outward.

🔄 Outputs

This is where things get interesting. The output type is dynamic and inferred from the connection context:

  • String: If connected to a node expecting a text-based input.
  • Number (float or int): If connected to a numeric input like seed, cfg, steps, etc.

The node will adapt its internal value parsing automatically when the output is connected to an input port. If you connect it to a sampler seed, it becomes a number. If you connect it to a prompt filename prefix, it becomes a string. Magic? No. Just solid type inference.

⚙️ Settings & Parameters (And What They Really Do)

FieldTypeDescription
valueAuto (String or Number)The only field in the Primitive node. You manually type in a string, integer, or float, and it adapts based on what node you connect it to. Want 42 to behave as a seed in multiple samplers? Just enter 42 and connect away. Need a filename like output_image_01? Go ahead, Primitive can handle that too.

Note: The node does not ask you what type you're entering. It infers it once you make the connection. So if you're seeing weird behavior, check your wires.

  • Centralized Seed Control: Use one Primitive node to control the seed across multiple KSamplers for deterministic outputs.
  • Synchronized Filename Prefixes: Output images from various branches using the same naming scheme.
  • Shared Numeric Parameters: Send a single float or int value to multiple nodes like cfg, denoise, or custom modules.
  • Reusable String Tokens: For nodes that require class tokens, tags, or filenames, you can centralize them in one Primitive node.

🔁 Example Workflow Setup

Let’s say you’re running three KSamplers, and you want them to all use the same seed:

  1. Drop in one Primitive node.
  2. Set value to 123456.
  3. Connect the Primitive’s output to the seed input of each KSampler.
  4. Congratulations, you just centralized seed management like a pro.

💬 Prompting Tips

While this node doesn’t handle prompts directly, here are some edge-case tricks:

  • Use a Primitive node to dynamically set prompt suffixes or prefixes by connecting it to nodes that use filename_prefix, prompt_fragment, or similar.
  • Combine it with nodes like String Combine or Conditioning nodes to construct more flexible prompts.

🔥 What-Not-To-Do-Unless-You-Want-a-Fire

  • Don’t expect it to auto-convert between incompatible types — Primitive will change type only based on what it's connected to, not based on your intentions.
  • Don’t connect one Primitive to multiple different types (e.g., one input needs a float, another needs a string) — it will adapt to one, and the others might throw type mismatch errors.
  • Don’t forget to recheck connections when you copy or modify your workflow — Primitive might cling to its old inferred type.

⚠️ Known Issues

  • Type Locking Quirks: Sometimes, once a type is inferred, disconnecting doesn’t always reset it visually. Reconnect it to the new input type and refresh the graph if needed.
  • No Manual Type Selector: You can’t explicitly set the type (yet). It’s 100% context-driven.
  • UI Doesn’t Validate Input Until Connection: If you type a string and then connect to a float input, you may get a silent failure or an error.

🧼 Final Notes

The Primitive node is one of those “why didn’t I use this earlier” tools. It’s clean, flexible, and downright necessary for anyone building moderately complex workflows in ComfyUI. It's also criminally underrated — but you? You know better now.

Go forth and reduce redundancy. Let your values live in one place. Be the architect of your own efficient, elegant graph.

Got multiple samplers, conditionings, or filename suffixes screaming for consistency?
Primitive node. Use it. Love it. Document it (well, we just did).