Latent Crop Offset JK๐
Why your crop offset needs +8
- latent_offset
Every once in a while ComfyUI needs a node that exists to translate one coordinate system into another, and this is one of them. Latent Crop Offset JK converts an image-space crop offset into the equivalent latent-space offset. The entire mechanism is a single addition: it takes your image offset and returns image_offset + 8.
Why the +8
Here's the thing everyone forgets: latents are smaller than pixels. The VAE compresses the image - for the SD-family models used throughout this pack, the latent is 1/8th the spatial size of the image. So if you crop an image starting 16 pixels in and you want to apply the same crop to the latent, you need to move 16/8 = 2 latent pixels, not 16.
The + 8 is a small alignment padding baked into the pack's crop-and-stitch logic to keep positions consistent after rounding and tiling. It's not magic - it's a fudge factor that makes "crop here, inpaint, stitch back" workflows line up without off-by-one smearing at the seams.
When you'd use it
Jake's image-gen and inpaint group nodes do crop-and-stitch internally: crop a region, work on it at higher effective resolution, then paste it back. Those nodes need the offset in both spaces - image space for the visible crop, latent space for the VAE-encoded region. This node sits between them, converting one to the other so the latent crop lands exactly where the image crop did.
Realistically you won't wire it by hand unless you're rebuilding one of those groups yourself. When you do, it's the glue between "how far did I crop in pixels" and "where is that in the latent."
One honest warning
This node is marked deprecated in the pack source. Deprecated in JakeUpgrade doesn't mean removed - the pack hides deprecated nodes behind config.ini (LOAD_DEPRECATED_NODES = True) - but it does mean newer workflows prefer doing this math inline or inside group nodes. If it's not in your node list, that's expected; enable it only if an older workflow you loaded actually needs it. Don't add it fresh to a new workflow.
Install
Same pack, same drill:
cd ComfyUI/custom_nodes
git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
pip install -r requirements.txt
Restart, and if you need the deprecated nodes, flip LOAD_DEPRECATED_NODES = True in the pack's config.ini and restart again. Pure Python - no models, no GPU work.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image_offset | INT | 0 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent_offset | INT | โ |