Nodes/ComfyUI-CustomNodePacks/C2C Vault (protected subgraph)
ComfyUI Node

C2C Vault (protected subgraph)

Your Workflow Is Inside the PNG. This Node Puts It in a Vault

By Code2Collapse·Created 8 months ago·Updated about 18 hours ago· 59
C2C Vault (protected subgraph)
    • out_0
    • out_1
    • out_2
    • out_3
    • out_4
    • out_5
    • out_6
    • out_7
    • out_8
    • out_9
    • out_10
    • out_11
    • out_12
    • out_13
    • out_14
    • out_15
    • out_16
    • out_17
    • out_18
    • out_19
    • out_20
    • out_21
    • out_22
    • out_23
    • out_24
    • out_25
    • out_26
    • out_27
    • out_28
    • out_29
    • out_30
    • out_31
    • out_32
    • out_33
    • out_34
    • out_35
    • out_36
    • out_37
    • out_38
    • out_39
    • out_40
    • out_41
    • out_42
    • out_43
    • out_44
    • out_45
    • out_46
    • out_47
    • out_48
    • out_49
    • out_50
    • out_51
    • out_52
    • out_53
    • out_54
    • out_55
    • out_56
    • out_57
    • out_58
    • out_59
    • out_60
    • out_61
    • out_62
    • out_63
    • out_64
    • out_65
    • out_66
    • out_67
    • out_68
    • out_69
    • out_70
    • out_71
    • out_72
    • out_73
    • out_74
    • out_75
    • out_76
    • out_77
    • out_78
    • out_79
    • out_80
    • out_81
    • out_82
    • out_83
    • out_84
    • out_85
    • out_86
    • out_87
    • out_88
    • out_89
    • out_90
    • out_91
    • out_92
    • out_93
    • out_94
    • out_95
    • out_96
    • out_97
    • out_98
    • out_99
    • out_100
    • out_101
    • out_102
    • out_103
    • out_104
    • out_105
    • out_106
    • out_107
    • out_108
    • out_109
    • out_110
    • out_111
    • out_112
    • out_113
    • out_114
    • out_115
    • out_116
    • out_117
    • out_118
    • out_119
    • out_120
    • out_121
    • out_122
    • out_123
    • out_124
    • out_125
    • out_126
    • out_127
    • out_128
    • out_129
    • out_130
    • out_131
    • out_132
    • out_133
    • out_134
    • out_135
    • out_136
    • out_137
    • out_138
    • out_139
    • out_140
    • out_141
    • out_142
    • out_143
    • out_144
    • out_145
    • out_146
    • out_147
    • out_148
    • out_149
    • out_150
    • out_151
    • out_152
    • out_153
    • out_154
    • out_155
    • out_156
    • out_157
    • out_158
    • out_159
    • out_160
    • out_161
    • out_162
    • out_163
    • out_164
    • out_165
    • out_166
    • out_167
    • out_168
    • out_169
    • out_170
    • out_171
    • out_172
    • out_173
    • out_174
    • out_175
    • out_176
    • out_177
    • out_178
    • out_179
    • out_180
    • out_181
    • out_182
    • out_183
    • out_184
    • out_185
    • out_186
    • out_187
    • out_188
    • out_189
    • out_190
    • out_191
    • out_192
    • out_193
    • out_194
    • out_195
    • out_196
    • out_197
    • out_198
    • out_199
    • out_200
    • out_201
    • out_202
    • out_203
    • out_204
    • out_205
    • out_206
    • out_207
    • out_208
    • out_209
    • out_210
    • out_211
    • out_212
    • out_213
    • out_214
    • out_215
    • out_216
    • out_217
    • out_218
    • out_219
    • out_220
    • out_221
    • out_222
    • out_223
    • out_224
    • out_225
    • out_226
    • out_227
    • out_228
    • out_229
    • out_230
    • out_231
    • out_232
    • out_233
    • out_234
    • out_235
    • out_236
    • out_237
    • out_238
    • out_239
    • out_240
    • out_241
    • out_242
    • out_243
    • out_244
    • out_245
    • out_246
    • out_247
    • out_248
    • out_249
    • out_250
    • out_251
    • out_252
    • out_253
    • out_254
    • out_255
    ◄vault_id►
    ◄vault_payload►

    Every PNG that leaves ComfyUI carries the entire workflow that made it - graph, values, seed - as text inside the file. Drop it back on the canvas and the pipeline rebuilds itself. That's the best thing about this ecosystem, it's why "workflow included" became a norm, and it's also why you physically cannot hand someone a render without handing them the recipe.

    C2C Vault (protected subgraph) is the pack's answer to that. Select a chunk of your graph, lock it, and from then on the outside is one ordinary node while the inside travels as ciphertext.

    It's a subgraph, not a new kind of graph

    The most important thing to understand: a vault is a protected subgraph. ComfyUI's own scheduler runs the inside, exactly as it would run any subgraph, and reopening it hands you a native subgraph to edit. Only the serialization changes.

    The inside is AES-256-GCM ciphertext (format v2, password stretched with Argon2id); what sits in your workflow JSON is that blob plus the sockets the subgraph exposed. Everything outside stays plain JSON.

    The two inputs you'll never type

    vault_id and vault_payload. The payload is the ciphertext, the id the vault's identity. Both default to empty, and the node refuses to run on a blank payload with This C2C Vault is empty: lock a selection or a subgraph first - the error you get if you add the node from the Add Node menu instead of making a vault properly.

    You make one by selecting nodes and right-clicking the canvas: 🔒 Seal as C2C Vault or 🔒 Lock as C2C Vault. For an existing subgraph, right-click the node → Protect this subgraph as C2C Vault. The dialog explains each profile and asks for a password.

    Outputs are out_0 through out_255, all of type ANY. That's headroom, not homework - the expansion fills as many as the inside actually produced and pads the rest. You don't wire them by hand: the sockets are the wires that crossed your selection, reappearing by name on the vault node.

    The three profiles

    • Sealed, authorized installations (the default) - runs with no password on your machine and on installs whose codes you paste in at seal time. The one to use for client work.
    • Locked - the vault password is asked once per browser tab, then it runs.
    • Legacy portable - runs anywhere with no password, and is obfuscation only. A knowledgeable recipient can pull the graph out.

    Opening it again

    Double-click the vault, or right-click → Open / edit vault…, then password plus a 6-digit code. First time on an install it enrols an authenticator - save the 8 recovery codes. A code works once. Leaving the subgraph re-encrypts it immediately, and while it's open, saving, autosave, export and queueing still write it locked.

    Installing it

    Manager → search CustomNodePacks, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git
    

    This family has one dependency you should actually care about: cryptography>=41.0 from the pack's requirements.txt supplies AES-GCM. Without it the vault can't decrypt anything:

    pip install "cryptography>=41.0"
    

    Restart and look for the pack's 115 nodes loaded line in the console.

    What it protects, and what it doesn't

    Here's the part most write-ups fudge. A vault keeps your nodes out of the workflow file, browser storage, history, messages and saved images - messages name the vault, an error inside names only the inner node's type. What it does not do is hide anything from someone who can run it: a vault has to be decrypted to execute, so anyone who can run it can in principle extract it, and so can anyone running Python inside that ComfyUI process. The authenticator guards editing through the UI; it is not extra encryption.

    So use it for what it is: a lock on the file and the editing UI, good enough for client work and for sharing a pipeline without handing over the recipe. If you just want someone to press Run and see sliders, ComfyUI's own App Mode is the lighter, more honest tool. A vault earns its keep when the recipient needs the actual .json.

    Troubleshooting

    If a run fails with "This workflow needs custom nodes that are not installed", hit Install on the vault node - it lists them and asks first.

    A second ComfyUI for the same OS user shares the credential store; C2C_SECRETS_BACKEND=file gives it its own key and authenticator.

    Vaults from older pack versions (C2C Vault - Locked / - Sealed) upgrade on load, but a promoted parameter converted into a param_N socket keeps its stored value and loses that wire - reconnect it.

    And C2C_VAULT_NATIVE=off refuses native vault execution entirely - the switch for when a vault is in your way rather than in your workflow.

    Category🐺 C2C/🧰 Core/Vault

    Inputs (2)

    NameTypeDefaultDescription
    vault_idSTRING—
    vault_payloadSTRING—

    Outputs (256)

    NameTypeDescription
    out_0*—
    out_1*—
    out_2*—
    out_3*—
    out_4*—
    out_5*—
    out_6*—
    out_7*—
    out_8*—
    out_9*—
    out_10*—
    out_11*—
    out_12*—
    out_13*—
    out_14*—
    out_15*—
    out_16*—
    out_17*—
    out_18*—
    out_19*—
    out_20*—
    out_21*—
    out_22*—
    out_23*—
    out_24*—
    out_25*—
    out_26*—
    out_27*—
    out_28*—
    out_29*—
    out_30*—
    out_31*—
    out_32*—
    out_33*—
    out_34*—
    out_35*—
    out_36*—
    out_37*—
    out_38*—
    out_39*—
    out_40*—
    out_41*—
    out_42*—
    out_43*—
    out_44*—
    out_45*—
    out_46*—
    out_47*—
    out_48*—
    out_49*—
    out_50*—
    out_51*—
    out_52*—
    out_53*—
    out_54*—
    out_55*—
    out_56*—
    out_57*—
    out_58*—
    out_59*—
    out_60*—
    out_61*—
    out_62*—
    out_63*—
    out_64*—
    out_65*—
    out_66*—
    out_67*—
    out_68*—
    out_69*—
    out_70*—
    out_71*—
    out_72*—
    out_73*—
    out_74*—
    out_75*—
    out_76*—
    out_77*—
    out_78*—
    out_79*—
    out_80*—
    out_81*—
    out_82*—
    out_83*—
    out_84*—
    out_85*—
    out_86*—
    out_87*—
    out_88*—
    out_89*—
    out_90*—
    out_91*—
    out_92*—
    out_93*—
    out_94*—
    out_95*—
    out_96*—
    out_97*—
    out_98*—
    out_99*—
    out_100*—
    out_101*—
    out_102*—
    out_103*—
    out_104*—
    out_105*—
    out_106*—
    out_107*—
    out_108*—
    out_109*—
    out_110*—
    out_111*—
    out_112*—
    out_113*—
    out_114*—
    out_115*—
    out_116*—
    out_117*—
    out_118*—
    out_119*—
    out_120*—
    out_121*—
    out_122*—
    out_123*—
    out_124*—
    out_125*—
    out_126*—
    out_127*—
    out_128*—
    out_129*—
    out_130*—
    out_131*—
    out_132*—
    out_133*—
    out_134*—
    out_135*—
    out_136*—
    out_137*—
    out_138*—
    out_139*—
    out_140*—
    out_141*—
    out_142*—
    out_143*—
    out_144*—
    out_145*—
    out_146*—
    out_147*—
    out_148*—
    out_149*—
    out_150*—
    out_151*—
    out_152*—
    out_153*—
    out_154*—
    out_155*—
    out_156*—
    out_157*—
    out_158*—
    out_159*—
    out_160*—
    out_161*—
    out_162*—
    out_163*—
    out_164*—
    out_165*—
    out_166*—
    out_167*—
    out_168*—
    out_169*—
    out_170*—
    out_171*—
    out_172*—
    out_173*—
    out_174*—
    out_175*—
    out_176*—
    out_177*—
    out_178*—
    out_179*—
    out_180*—
    out_181*—
    out_182*—
    out_183*—
    out_184*—
    out_185*—
    out_186*—
    out_187*—
    out_188*—
    out_189*—
    out_190*—
    out_191*—
    out_192*—
    out_193*—
    out_194*—
    out_195*—
    out_196*—
    out_197*—
    out_198*—
    out_199*—
    out_200*—
    out_201*—
    out_202*—
    out_203*—
    out_204*—
    out_205*—
    out_206*—
    out_207*—
    out_208*—
    out_209*—
    out_210*—
    out_211*—
    out_212*—
    out_213*—
    out_214*—
    out_215*—
    out_216*—
    out_217*—
    out_218*—
    out_219*—
    out_220*—
    out_221*—
    out_222*—
    out_223*—
    out_224*—
    out_225*—
    out_226*—
    out_227*—
    out_228*—
    out_229*—
    out_230*—
    out_231*—
    out_232*—
    out_233*—
    out_234*—
    out_235*—
    out_236*—
    out_237*—
    out_238*—
    out_239*—
    out_240*—
    out_241*—
    out_242*—
    out_243*—
    out_244*—
    out_245*—
    out_246*—
    out_247*—
    out_248*—
    out_249*—
    out_250*—
    out_251*—
    out_252*—
    out_253*—
    out_254*—
    out_255*—