Nodes/ComfyUI 1hewNodes/Image Resize Jimeng
ComfyUI Node

Image Resize Jimeng

Size your images for Jimeng's exact buckets — locally, in two clicks

By 1hew·Created about a year ago·Updated 7 days ago· 33
Image Resize Jimeng
  • image
  • mask
  • image
  • mask
preset_sizeauto (2k | 4k)
fitcrop
pad_color1.0

If you've seen "Jimeng" in a workflow and wondered what it is: it's ByteDance's image generation model (即梦), and like most cloud image models it only accepts a fixed set of output dimensions. Those dimensions aren't your typical 1024x1024-or-nothing list either - Jimeng's buckets run to oddballs like 1472x1104 (4:3) and 936x1664 (9:16), plus a separate "2.0 pro" tier of small sizes like 1024x682. This node is a local adapter for exactly that table. No API calls, no account, no key - it just reshapes your image and mask to the nearest Jimeng-supported resolution.

It lives in the same family as the pack's other model-size adapters (GPT Image 2.0, Gemini, Qwen Image). If you've used any of those, you know the drill already: pick a preset or an auto mode, choose how to fit, done.

How it works

The node has a hardcoded preset table organized into tiers: [1k], [2k], [4k], and [2.0_pro] ratios. The interesting wrinkle is the two-tier auto modes - auto (1k | 2k) and auto (2k | 4k) - which decide the tier from your source's pixel area and then snap to the nearest aspect ratio within it. auto (2k | 4k) is the default, and it's a sensible one: small sources land in 2k, big sources jump to 4k, and you don't have to think about which tier your image "deserves."

Beyond that, it's the same engine as the pack's other resize nodes:

  • preset_size - the dropdown with all the auto modes plus every named preset.
  • fit - crop (center-crop to the target ratio, default), pad (fit inside, fill bars with pad_color), or stretch (distort).
  • pad_color - default 1.0 (white), accepts RGB strings and named colors.

The image resizes bicubic; the mask resizes nearest-neighbor in lockstep, so a hard mask stays hard. Both come out the far end at exactly the same size, ready for whatever expects Jimeng-shaped inputs.

When you'd actually use this

Honest answer: if your whole pipeline is local SDXL or Flux, you don't strictly need Jimeng's preset sizes - they're not magic numbers for local models. Where this earns its keep is preparing inputs for a Jimeng-based step (a cloud call, an API relay, or a workflow someone shared that was built around Jimeng) and for keeping image-to-video or edit passes dimension-consistent when the downstream is picky. It's also just a tidy way to get a specific aspect ratio you like without mental math - pick [1k] 1584x1056 (3:2) and you're done.

Installing it

Part of the 1hewNodes pack. Through ComfyUI Manager, search "ComfyUI 1hewNodes" and install; or clone:

cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes

Restart ComfyUI. No model downloads, no API key, no Jimeng account needed for this node to function.

Common issues

The main thing that trips people up is treating auto as freeform resize. It's not - it snaps to Jimeng's supported set. If your source is an unusual ultrawide, it'll pick the closest ratio and crop will lop the ends off. Switch fit to pad if you'd rather keep the full frame with bars. And remember the 2.0 pro tier is a different size family than the 1k/2k/4k tiers - if a shared workflow expects pro dimensions, grab one of those presets directly rather than trusting auto to take you there.

Category1hewNodes/image/resize

Inputs (5)

NameTypeDefaultDescription
preset_sizeCOMBOauto (2k | 4k)38 options: auto, auto (1k), auto (2k), auto (4k), auto (1k | 2k), auto (2k | 4k), +32
fitCOMBOcrop3 options: crop, pad, stretch
pad_colorSTRING1.0
imageoptIMAGE
maskoptMASK

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK