jquesnelle / txt2imghd

A port of GOBIG for Stable Diffusion
MIT License
691 stars 82 forks source link

Fix resize : keep same size for slices #5

Closed Oros42 closed 2 years ago

Oros42 commented 2 years ago

When you use og_size = (int(source_image.size[0] / 2), int(source_image.size[1] / 2)), for each step the size of slices double. By fixing the size, we are sure that it will not explode the VRAM's use.

TDiffff commented 2 years ago

og_size = (int(sourceimage.size[0] / (2**(\+1))), int(sourceimage.size[1] / (2**(\+1)))) this works too ^^

Oros42 commented 2 years ago

@TDiffff yes that was my first idea. But I realized that the result is always equal to og_size = (opt.H,opt.W)

jquesnelle commented 2 years ago

Agreed -- my first thought is we'd want to increase the tiles as the image gets bigger, but this obviously gets intractable quickly