Files
2026-04-17 01:29:08 +03:00
..
2026-04-17 01:09:25 +03:00
2026-04-17 01:29:08 +03:00
2026-04-17 00:57:42 +03:00

CNPFormat

CNP Format is a ComfyUI custom node for building strings with printf-style placeholders.

Features

  • Outputs a single STRING
  • Uses a format string with placeholders such as %s, %u, %d, %f, and %%
  • Auto-expanding argument inputs in the UI
  • Accepts mixed input types through wildcard inputs

Example

Format:

Size: %u x %u | CFG: %.1f | Prompt: %s

Arguments:

  • arg_1 = 1024
  • arg_2 = 1536
  • arg_3 = 7.5
  • arg_4 = "cinematic night city"

Output:

Size: 1024 x 1536 | CFG: 7.5 | Prompt: cinematic night city

Supported placeholders

  • %s string
  • %u unsigned integer style formatting
  • %d / %i integer
  • %f / %e / %g float
  • %x / %X / %o integer formatting
  • %c character
  • %% literal percent sign

Notes

  • The node keeps one empty trailing input so users can continue attaching more arguments.
  • If the format string requires more arguments than are connected, the node raises a readable error.
  • Extra connected arguments beyond the placeholders are ignored.