StableCascade icon indicating copy to clipboard operation
StableCascade copied to clipboard

How to run Super Resolution code?

Open zelenooki87 opened this issue 1 year ago • 2 comments

I'm really struggling to figure it out. Thanks.

zelenooki87 avatar Feb 16 '24 19:02 zelenooki87

You would just run all the cells in the notebook that are for the SR ControlNet. Did you figure it out already or need more help?

dome272 avatar Feb 27 '24 11:02 dome272

with torch.no_grad(), torch.cuda.amp.autocast(dtype=torch.bfloat16):
    effnet_latents = core.encode_latents(batch, models, extras)
    effnet_latents_up = torch.nn.functional.interpolate(effnet_latents, scale_factor=2, mode="nearest")
    cnet = models.controlnet(effnet_latents_up)
    cnet_uncond = cnet
    cnet_input = torch.nn.functional.interpolate(images, scale_factor=2, mode="nearest")
    # cnet, cnet_input = core.get_cnet(batch, models, extras)
    # cnet_uncond = cnet
    
show_images(batch['images'])
show_images(cnet_input)

@dome272 I am confused by the above code snippet about super resolution.It seems to merely shows the result of direct upsampling.

cersar avatar Mar 01 '24 01:03 cersar