receyuki / comfyui-prompt-reader-node

The ultimate solution for managing image metadata and multi-tool compatibility. ComfyUI node version of the SD Prompt Reader
MIT License
269 stars 22 forks source link

Custom resolution enforces step 8 but with 1 as the minimum, meaning its impossible to choose standard resolutions #82

Open drmbt opened 2 months ago

drmbt commented 2 months ago

Description

see title. for instance, 1024 x 576 is impossible, because your code rounds step 8 with min 1 as the base, so 1025 x 577 is all you can do

Reproduction steps

try any standard resolution while custom is selected

Image file

No response

receyuki commented 2 months ago

What node do you usually connect it to? As far as I know, some built-in nodes use 1 as the step, but most use 8 as the step, like EmptyLatentImage. So I think setting the step to 8 can avoid unnecessary errors in the workflow.

drmbt commented 2 months ago

The point is it’s enforcing 8 step offset by one. So default resolution of 1024x1024 is impossible, it will only let me select 1025 or 1017

I don’t mind the rounding, I mind it rounding wrong. Also, if comfy isn’t going to force step 8 resolution for an empty latent image, maybe you shouldn’t either?

I forked and set step to 1 to fix it, but just wanted you to know that’s a problem

receyuki commented 2 months ago

I just realised what the problem is. I set the minimum value to 1, so when the step size is 8, the next number is 9, and then 17, which is always 1 more than the standard size. EmptyLatentImage has a minimum value of 16, so even with a step size of 8, there's no issue. Thanks a lot for your feedback. I'll fix this right away.

Here’s my solution:

  1. Since the step size for EmptyLatentImage is 8, I’ll keep it at 8.
  2. I’ll change the minimum value to 16 to match EmptyLatentImage.

(I did some extra tests, and it looks like sizes like 1025x1025 get automatically rounded down to 1024x1024 by EmptyLatentImage, so it doesn't affect the workflow).