TinyTerra / ComfyUI_tinyterraNodes

A selection of nodes for Stable Diffusion ComfyUI
GNU General Public License v3.0
421 stars 45 forks source link

Question about the hires upscale #156

Closed TyleRxYan closed 4 weeks ago

TyleRxYan commented 1 month ago

How is this thing work? the function seems not work like simple tiled resample, also not upscale by model, I've keep get multiple objects in final image if I bump the rescale percent above 50.

TinyTerra commented 1 month ago

It first does a model upscale and then does an image rescale (usually downscale).

using say 4x_NMKD-superscale model on a 512x512 image, it will 1) 4x model upscale > 2048x2048 2) 50% image scale > 1024x1024

that node (and the hiresfix upscale method within the ttN sampler nodes) performs a similar process to the nodes between the two samplers here: image

TyleRxYan commented 4 weeks ago

It first does a model upscale and then does an image rescale (usually downscale).

using say 4x_NMKD-superscale model on a 512x512 image, it will

  1. 4x model upscale > 2048x2048
  2. 50% image scale > 1024x1024

the pipeKSamplerSDXL is not quite like ttN hiresfixScale, the sample process is final stage, sorry I wasn't make it clear at first. If the progress like what you said, I think the problem is SDXL node

TinyTerra commented 4 weeks ago

The same process happens inside the SDXL kSampler.

Are you using the upscale within the ksampler?

in that case the upscale occurs first before the re-sampling (in the example image that would be the same as the second ksampler with the previous upscaling)

TyleRxYan commented 4 weeks ago

The same process happens inside the SDXL kSampler.

Are you using the upscale within the ksampler?

in that case the upscale occurs first before the re-sampling (in the example image that would be the same as the second ksampler with the previous upscaling)

yeah, the upscale within the ksampler.

71237f5b-32b2-46f4-8567-4a0b4201649c

TinyTerra commented 4 weeks ago

Here you are upscaling an empty latent - which is why this issue is happening.

The upscale is meant to be used after the initial sampling

hiresfix

A side note - If you're not using a refiner i'd recommend just using the regular pipeKsampler

TyleRxYan commented 4 weeks ago

I see, thank you for the patience.