EmAySee_ Qwen Resolution OptimizerFXD
The fixed Qwen resolution optimizer — use this one, not the original
- image
- IMAGE
- width
- height
- aspect_ratio_name
EmAySee Qwen Resolution Optimizer FXD is the corrected version of the pack's QwenResolutionOptimizer, and it's the one you should actually use. Same inputs, same outputs, same seven canonical aspect ratios - but the crop math is fixed so the image isn't subtly distorted on the way to its final resolution.
Here's the bug in the original, because it's illuminating: the non-FXD node crops the image to its target aspect ratio, then separately rounds the resize dimensions to a multiple of 112. Those two calculations can disagree by a few pixels. When the crop aspect and the final resize aspect don't exactly match, the resize does a tiny bit of squeezing to make up the difference. Usually invisible, occasionally the kind of thing that makes your subject look 2% wider than it should. The FXD fix is elegant: it computes the actual aspect ratio of the final rounded dimensions first, then crops to that ratio, so the crop and the resize agree exactly and nothing gets distorted.
Everything else is inherited from the original: pick the nearest of the seven Qwen ratios (1:1, 4:3, 3:2, 16:9, 3:4, 2:3, 9:16), scale by scale_multiplier, snap to a multiple of 112, and choose between crop and stretch.
The inputs that matter
Identical to the original:
image- the IMAGE to optimize.scale_multiplier- FLOAT from 0.1 to 4.0, default 1.0.method-crop(default) orstretch.upscale_method-bicubic(default),bilinear,nearest-exact,area.
Outputs: IMAGE, width, height, and aspect_ratio_name (the label like 16:9 Widescreen @ 1.0x (1344x784)).
How it works
The pipeline is: measure your input aspect → pick the closest of seven canonical ratios → scale its base resolution by scale_multiplier → round both dimensions to multiples of 112 → compute the true aspect of those rounded dimensions → center-crop to that true aspect (in crop mode) → resample with your chosen method. The order of operations is the whole story: rounding first, cropping to the rounded result, never the other way around.
Installing it
Part of the EmAySee pack:
# ComfyUI Manager: search "ComfyUI_EmAySee_CustomNodes" and install
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
Restart ComfyUI. No requirements.txt - torch only.
Common issues
The practical advice is short: don't reach for the plain QwenResolutionOptimizer when this exists. The author shipped the fix for a reason, and there's no downside to the FXD version - same API, same outputs, correct crop. The things to watch are the inherited ones: stretch mode still distorts by design, the base resolutions are fixed per ratio (aim them at whatever Qwen model you're prepping for), and this node only crops/resizes - it won't fix a bad input image. If you're feeding the result into QwenPromptFromImage for captioning, run this first and the model gets a clean, grid-aligned input. For that job, FXD is the pick of the family.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| scale_multiplier | FLOAT | 1.00.1–4 | — |
| method | COMBO | crop | 2 options: crop, stretch |
| upscale_method | COMBO | bicubic | 4 options: bicubic, nearest-exact, bilinear, area |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| width | INT | — |
| height | INT | — |
| aspect_ratio_name | STRING | — |