Nodes/ComfyUI-PhotoCraft Bridge/Photocraft ◂ Send Image
ComfyUI Node

Photocraft ◂ Send Image

The result lands as a layer, not as a file on your desktop

By the-aSak·Created 21 days ago·Updated 7 days ago· 13
Photocraft ◂ Send Image
  • images
  • target
  • mask
    ◄layer_nameComfyUI►
    ◄layer_maskfalse►

    Most ComfyUI inpainting ends the same way: you generate a nice patch, it appears in a preview widget, and then you go find it in output/, drag it into your editor, and line it up by hand. Photocraft ◂ Send Image deletes all of that. It takes the image your graph produced and puts it into PhotoCraft as a new layer, in the right place, over the selection it came from - and it has no outputs, because it isn't handing anything downstream. It's the end of the wire.

    That's the other half of the PhotoCraft Bridge: Get Image brings the canvas, the selection and your prompt into the graph, Send Image puts the result back. Round trip, no files, no manual alignment - a real substitute for the save → upload → mask → download → paste loop that has people keeping Photoshop open in a second window.

    What it actually does

    Mechanically it's the mirror image of Get. The tensor is written as an 8-bit RGBA PNG into the shared exchange folder, PhotoCraft is asked to open it, the new layer is renamed, then copied into the destination document at the offset recorded in target. The temp document is closed and the temp file deleted. Each image in the batch becomes its own layer, each a single undo step - Ctrl-Z takes you back a generation, not a pixel operation.

    Send finds the target document by its layer ids, not its name, so saving the file under a new name mid-run is fine. And if your workflow resized the image somewhere (a megapixel rescale, say), Send scales it back to the size Get handed out, trims Get's padding, and tells you in the console: [Photocraft] result … scaled to ….

    The inputs

    images is the IMAGE from your decode. layer_name (default ComfyUI) is the name of the layer you'll see in PhotoCraft's layer panel; leave it blank and no rename happens.

    Then the three optional ones, which is where the actual behaviour lives:

    target comes from Get Image. Connect it. It carries the destination document, the crop's origin, and - importantly - Get's mask. If you leave it unconnected, Send falls back to the last Get run's target as long as that document is still open; failing that, it drops into the active document at (0,0), or creates a new document if none is open. All of those are worse than just wiring it.

    mask overrides the selection travelling inside target. Here's the elegant part: leave it unconnected and Get's selection becomes the layer's alpha, so the generated pixels only show inside the lasso you drew. Connect a mask and it takes over - a Solid Mask of 1.0 replaces the whole cropped area, padding included.

    layer_mask changes what the mask becomes. Off, it's the layer's transparency. On, it's a real layer mask with the complete generated image underneath: paint white to reveal more, black to hide. Turn it on when you expect to fiddle with edges afterwards, since transparency is destructive in a way a mask isn't.

    Install

    Same pack, so the same steps - ComfyUI Manager, search "PhotoCraft Bridge," or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/the-aSak/ComfyUI-Photocraft-Bridge.git
    

    No Python dependencies (pyproject.toml declares none) and no model downloads. PhotoCraft itself still has to be started with its control channel and both automation roots pointed at the exchange folder, exactly as in the Get Image article - miss either and you get the same "no token file" or "not reachable on port 7878" error.

    Where people get burned

    The result is off by a few pixels. That's a resize node in the middle of the workflow that changed the aspect ratio or cropped an edge - the scaled to message in the console confirms it. Make that node round to multiples of 16, or drop it.

    mask (…) does not match image (…). A ValueError from Send: some mask in your graph drifted to a different resolution than the image. Walk back up the mask path and find the crop or resize that caused it.

    A half-transparent layer is not a bug. Since the mask becomes the layer's alpha, feeding a soft or feathered mask gives you a partially transparent layer by design. Use a hard mask, or switch on layer_mask.

    Depth and colour survive only so far. The exchange is 8-bit PNG both ways: a 16-bit document comes back as 8-bit layers, and colours outside sRGB clip in the areas you edited (unchanged pixels survive the profile round trip).

    Multiple Sends are allowed, and useful - one for the raw result, one for the masked composite, each landing as its own layer and its own undo step.

    CategoryPhotocraft

    Inputs (5)

    NameTypeDefaultDescription
    imagesIMAGE—
    layer_nameSTRINGComfyUI—
    targetoptPHOTOCRAFT_TARGET—
    maskoptMASK—
    layer_maskoptBOOLEANfalse—

    Outputs (0)

    No outputs