Image Injection Options ππ π
Positioning where an injected image lands
- IMG_INJECT_OPTS
This is the smallest node in the Image Injection family, and it does exactly one job: positioning. Its sibling, Image Injection, handles the actual mid-sampling anchoring - when the image gets injected, how strongly, and to what region via a mask. This node handles where in the canvas that image lands if it isn't filling the whole frame.
What it does
Two optional integer fields, composite_x and composite_y, both defaulting to 0 - the offset, in pixels, of where the injected image gets placed when compositing it into the latent. Leave both at 0 and the image composites from the top-left corner (or wherever the node's default placement behavior lands it); set them to reposition the injection somewhere else in the frame, useful when your injected image is smaller than the full canvas and you want it in a specific spot rather than the default.
Build one of these, plug it into Image Injection's img_inject_opts slot, and that's the whole interaction - this node has no logic of its own beyond carrying those two numbers.
There's a real reason resize_image on the main Image Injection node doesn't make this one redundant. Resizing scales your reference image to fit the latent's dimensions; it doesn't say anything about where a smaller image should sit if you'd rather keep its original size and composite it as a smaller element instead of stretching it to fill everything. That's specifically the gap this node fills: precise placement for an image that isn't meant to cover the whole frame, like a small logo, object, or partial reference you want anchored in one corner rather than blown up to match your canvas.
The inputs and outputs that matter
Optional: composite_x (default 0, range 0β16384) and composite_y (default 0, range 0β16384) - pixel offsets for where the injected image is placed in the canvas.
Output is a single IMG_INJECT_OPTS (IMAGE_INJECT_OPTIONS), and it only fits one place: the img_inject_opts slot on the Image Injection node.
How to install it
ComfyUI Manager: search AnimateDiff Evolved, confirm the author is Kosinkadink, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved
then restart. No model download tied to this node at all - it's two numbers, nothing more.
Common issues & troubleshooting
Built this node and nothing changed. Confirm the output is actually wired into Image Injection's img_inject_opts slot - this node does nothing on its own; it only affects behavior once it's feeding the node that actually performs the injection.
Image is positioned wrong even after setting offsets. Double-check whether your injected image is the same size as your generation canvas - if it already fills the frame, composite_x/composite_y have nothing meaningful to offset, since there's no extra space for the image to move within. Positioning only matters when the injected image is smaller than the full latent.
Not sure you need this node at all. You probably don't, unless you're specifically injecting an image that's smaller than your canvas and needs to land somewhere other than the default position. For a full-frame image injection, skip this node and leave Image Injection's img_inject_opts input unconnected - it's optional for a reason.
Coordinates go up to 16384 and your canvas obviously doesn't. That ceiling is just the node's generic upper bound, not a hint about typical values - in practice composite_x/composite_y should stay within your actual latent's pixel dimensions. Anything set well past your canvas size just pushes the injected image off-frame entirely, which reads as "nothing happened" rather than an error.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| composite_xopt | INT | 00β16384 | β |
| composite_yopt | INT | 00β16384 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMG_INJECT_OPTS | IMAGE_INJECT_OPTIONS | β |