ComfyUI Node

String As Any

Force a string into ComfyUI's wildcard type

By ruiqutech·Created 2 years ago·Updated 2 years ago· 0
String As Any
    • *
    string

    A one-job node: take a plain string and relabel its output as ComfyUI's wildcard * type instead of STRING, so it'll plug into any socket regardless of what that socket's declared type is. Same value going in and out - the only thing that changes is whether ComfyUI's type checker waves it through.

    Where you'd actually use this

    Some custom nodes - including a few in this same pack, like the in1...inN slots on the EvaluateMultiple family - declare their inputs as * specifically so they'll accept anything at all. StringAsAny is how you hand one of those a literal string you typed in directly, without first routing it through some unrelated node that happens to output plain STRING and hoping the type-mismatch is silently tolerated. It's a small, deliberate bypass for a specific and common situation, not a general "connect anything to anything" tool.

    The trade-off, and the community already argued about this

    Type checking exists to catch mistakes before a workflow runs - wire the wrong thing into a socket and ComfyUI tells you immediately instead of letting it fail deep into execution. Nodes that force a value's type to * opt out of that safety net on purpose. This is exactly the tension the ComfyUI community has had a real, pointed argument about: a popular extension that routes any output to any input regardless of declared type drew a post titled "Please Stop using the Anything Anywhere extension," arguing it makes workflows impossible to debug and understand even though it's genuinely convenient. StringAsAny is a much smaller, more deliberate version of the same trade - one string, one socket, your explicit choice - but the underlying risk is the same: if the receiving node can't actually work with what you handed it, ComfyUI won't catch that for you at build time anymore. You'll find out when it runs.

    Inputs and outputs

    • string (STRING, multiline) - what you're typing in.
    • Output: * - the same value, wildcard-typed.

    Installing it

    ComfyUI Manager: search RuiquNodes, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ruiqutech/ComfyUI-RuiquNodes
    

    then restart. No models or dependencies to fetch.

    Common issues

    The downstream node errors on the value. That's the type system's usual protection working in reverse - it let the wire through, and now the receiving node's own code is what's rejecting the value because it wasn't actually built to handle a string. Check what the receiving node genuinely expects before assuming StringAsAny is the problem.

    You didn't need this at all. If the socket you're targeting is actually declared STRING, plug your string in directly - StringAsAny is only necessary when the target is typed * (or some other type you're deliberately routing around), not as a general substitute for a normal typed string node.

    Categoryruiqu/any

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRING

    Outputs (1)

    NameTypeDescription
    **