VAEEncodeForInpaint_motorway_edition
The proper way to start an inpaint — pixels, mask, and all
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
Inpainting has a specific first move: you don't just encode the image, you encode it with the mask in mind so the sampler knows which region is up for grabs. That's the whole job of VAEEncodeForInpaint - it takes pixels, a VAE, and a mask, and produces a latent plus a noise mask that tells the sampler to only redraw inside the masked area. This _motorway_edition clone does the same thing through the agilly1989 Motorway pipe, pulling all three inputs from the shared dict by key.
The Motorway in 20 words: start with MotorwayStart, then every _motorway_edition node swaps data wires for key strings, reading and writing a shared dict that flows down one MOTORWAY connection. The clones are generated from ComfyUI's own registry, so underneath this is stock VAEEncodeForInpaint.
What it does. It takes pixels (the base image), vae (the encoder), and mask (where the inpaint happens), encodes the image to a latent, and attaches a noise mask so sampling only touches the masked region. The one setting is grow_mask_by (default 6) - it expands the mask by a few pixels before encoding, which keeps the edit seamless by giving the model a little runway around the edge. A grow of 0 means the mask is used as-is and you're more likely to see a hard boundary. The latent that comes out is meant to be the starting point for your sampler, with the mask making sure the unmasked pixels stay put.
The inputs that matter. MOTORWAY is required. INPUT_pixels_key (default pixels), INPUT_vae_key (default vae), and INPUT_mask_key (default mask) point at where those three live in the dict. Mind the case trap: a VAE stored by VAELoader_motorway_edition sits under VAE uppercase, but the default here is vae - retype it or you'll hit 'MotorwayClass' object has no attribute 'hash_', the pack's "key not found" error. OUTPUT_LATENT_key (default LATENT) is where the inpaint latent is stored. Output: the MOTORWAY port only.
Common issues. The classic inpaint mistakes still apply: a blurry or poorly drawn mask gives you a blurry edit, and encoding a huge image at full res is slow. On the Motorway side, the key/case traps are the recurring pain - get those three input keys right and the rest is stock behavior. And the standing caveat: the pack's current main branch has the clone registration commented out in __init__.py, so if the node isn't in your menu, that's the version you're on.
Install via ComfyUI Manager (search "ComfyUI_agilly1989_motorway") or clone into custom_nodes, restart, no models to download. Solo-dev beta pack - the Motorway is a tidy-up layer, and for an inpaint chain with several moving parts, keeping them all in one dict by key is genuinely where a pipe like this earns its keep.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — | |
| INPUT_pixels_key | STRING | pixels | — |
| INPUT_vae_key | STRING | vae | — |
| INPUT_mask_key | STRING | mask | — |
| grow_mask_by | INT | 60–64 | — |
| OUTPUT_LATENT_key | STRING | LATENT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |