Image Resize Doubao Seedream 5.0 Pro
Stop the API guessing your output size
- image
- mask
- image
- mask
- native_image
- native_mask
What it's for
Seedream is ByteDance's image line and it's API-only - flagships stay closed, components get Apache 2.0. So you're going through an API node, and you have the classic hosted-API problem: you can ask for 16:9, but what comes back is the service's idea of 16:9, snapped to its own size table. Your reference is 2000×1125, the API returns 2048×1152, and every downstream node that assumed your framing is now off by a crop.
Image Resize Doubao Seedream 5.0 Pro solves that by doing the snapping before the call. It resizes the image and its mask to an exact entry from Seedream 5.0 Pro's official size table, so when that reference goes into the API node's image_1 with aspect_ratio=auto, the ratio inferred from it lands on the same preset - and the generated image comes back at exactly the size this node emitted. This is a size adapter, and its job is to make a remote model's dimension lottery stop mattering.
It's built to pair with the Doubao Seedream 5.0 Pro API node from the separate 1hewOffice pack - the same author's API-side work. Its 24 preset entries are item-for-item identical to that node's SIZE_MAP, which is what makes the two match.
How sizing works
Four flavours of preset_size:
auto- reads the input area, picks the nearest tier (1k/1.5k/2k), then picks the closest-aspect preset within that tier. It compares aspect ratios in log space, with a 2% tolerance band, and breaks ties by which candidate area is nearest your input's.auto (1k)/auto (1.5k)/auto (2k)- same matching, tier fixed. This is the mode you want if you care about exactness.dynamicanddynamic (1k|1.5k|2k)- scale from your input aspect ratio rather than snapping to the table, 16-px aligned, clamped to Seedream's 1:16–16:1 range with a 4096 longest-edge cap.- An explicit preset - a fixed size, no inference at all.
The official table, for reference:
| Ratio | 1k | 1.5k | 2k | |---|---|---|---| | 1:1 | 1024×1024 | 1536×1536 | 2048×2048 | | 4:3 | 1152×864 | 1792×1344 | 2368×1776 | | 3:4 | 864×1152 | 1344×1792 | 1776×2368 | | 16:9 | 1424×800 | 2048×1152 | 2816×1584 | | 9:16 | 800×1424 | 1152×2048 | 1584×2816 | | 3:2 | 1248×832 | 1872×1248 | 2496×1664 | | 2:3 | 832×1248 | 1248×1872 | 1664×2496 | | 21:9 | 1568×672 | 2352×1008 | 3136×1344 |
Eight ratios, no 5:4, no 2:1, no 3:1. If you need one of those, you're picking the nearest and living with it.
Inputs and outputs
preset_size (default auto (2k)), fit, pad_color, and optional image / mask. fit is crop (center-crop to the target ratio, then scale), pad (scale to fit, then center-pad), or stretch (just resize, aspect be damned). pad_color is a STRING and understands more than you'd expect: a grey value like the default 1.0, a HEX or RGB triplet, a colour name, or one of the fill strategies edge, average, extend, mirror.
Outputs are image, mask, then native_image / native_mask - a same-ratio copy of the main output anchored to the source scale. Identical crop and padding, different resolution only: the escape hatch for "I want the framing the model will produce without upscaling my reference to 2048×2048".
Install
Shipped in ComfyUI 1hewNodes. Manager → search the pack title, or:
cd ComfyUI/custom_nodes
git clone https://github.com/1hew/ComfyUI-1hewNodes
pip install -r ComfyUI-1hewNodes/requirements.txt
Restart ComfyUI. The resize nodes have no model downloads and no GPU dependency beyond torch - the long pip list is the rest of the pack (rembg, ultralytics, av, psd-tools). You do, obviously, need your Seedream API route set up separately; this node only prepares the pixels.
Where people get tripped up
dynamic* won't reproduce exactly through the API. Dynamic sizes aren't in the official table; feed one back into the API node and auto snaps to the nearest table ratio, so the generated size won't match the node output - the aspect is roughly preserved, the pixels aren't. Use auto (...) or an explicit preset when you need an exact match.
Text-to-image has no size control here. The Seedream API node can't take an explicit size (unlike the Qwen Image 3.0 / GPT Image 2.0 ones), so this node only influences the ratio through the reference image. Dimensions for a pure text-to-image run are set on the API node itself.
Full-frame or nothing. fit=crop with no mask connected still gives you a mask output, but it marks the kept region rather than the whole frame - so if you skipped the mask input assuming you'd get an all-white one, check it before using it downstream.
Don't cross the tables. These presets differ from the pack's Qwen Image 3.0 Pro and GPT Image 2.0 nodes, because each model has its own official table. Mixing them feeds the API a size it will silently round.
Every call costs money. Seedream 5.0 is hosted, not local; the little community discussion around it is API and pricing talk, not tooling.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| preset_size | COMBO | auto (2k) | 32 options: auto, auto (1k), auto (1.5k), auto (2k), dynamic, dynamic (1k), +26 |
| fit | COMBO | crop | 3 options: crop, pad, stretch |
| pad_color | STRING | 1.0 | — |
| imageopt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| native_image | IMAGE | — |
| native_mask | MASK | — |