StableSR icon indicating copy to clipboard operation
StableSR copied to clipboard

about size match of tensor

Open zcdliuwei opened this issue 1 year ago • 4 comments

First of all, thank you for your amazing open source project I used the following image as my low resolution input, with width and height of 512 and 768 respectively: d7bc8707-94c4-4c2a-a031-3e0764396b31

Then, I wanted to super-resolution to 1024 and executed the following command: python scripts/sr_val_ddpm_text_T_vqganfin_oldcanvas_tile.py --config configs/stableSRNew/v2-finetune_text_T_512.yaml --ckpt ckpt/stablesr_turbo.ckpt --init-img inputs/test_example --outdir output --ddpm_steps 4 --dec_w 0.5 --seed 42 --n_samples 1 --vqgan_ckpt ckpt/vqgan_cfw_00011.ckpt --colorfix_type wavelet --upscale 2

Then I received the following error message: image

Strangely, when I changed upscale to 1, 3, 4, 5, 6, and 7, I all got the expected results, except for an error when upscale=2 was reported,I hope to receive your guidance,thanks!

zcdliuwei avatar May 09 '24 08:05 zcdliuwei

Hi. This is because you are using a tile size larger than your image size. See here.

IceClear avatar May 09 '24 14:05 IceClear

Hi. This is because you are using a tile size larger than your image size. See here.

Thank you for your reply

Do you mean that the tile size should be smaller than the target resolution of 1024, in my case?

But when I used the following command, specifying tile size=1600, which is greater than the target resolution of 1024, I obtained the correct super-resolution result: python scripts/sr_val_ddpm_text_T_vqganfin_oldcanvas_tile.py --config configs/stableSRNew/v2-finetune_text_T_512.yaml --ckpt ckpt/stablesr_turbo.ckpt --init-img inputs/test_example --outdir output --ddpm_steps 4 --dec_w 0.5 --seed 42 --n_samples 1 --vqgan_ckpt ckpt/vqgan_cfw_00011.ckpt --colorfix_type wavelet --upscale 2 --vqgantile_size 1600

Similarly, when I scaled down tile size=512 and vqgantile_strid=500, there was no error reported: python scripts/sr_val_ddpm_text_T_vqganfin_oldcanvas_tile.py --config configs/stableSRNew/v2-finetune_text_T_512.yaml --ckpt ckpt/stablesr_turbo.ckpt --init-img inputs/test_example --outdir output --ddpm_steps 4 --dec_w 0.5 --seed 42 --n_samples 1 --vqgan_ckpt ckpt/vqgan_cfw_00011.ckpt --colorfix_type wavelet --upscale 2 --vqgantile_size 512 --vqgantile_strid 500

zcdliuwei avatar May 09 '24 16:05 zcdliuwei

Hi. Sry for the late reply since I am quite busy recently. It seems like a size checking problem since the default tile size of sr_val_ddpm_text_T_vqganfin_oldcanvas_tile is 1280 and for images below 1280 we usually use sr_val_ddpm_text_T_vqganfin_oldcanvas w/o tiling. You may either adjust the default tiling size in sr_val_ddpm_text_T_vqganfin_oldcanvas_tile or try sr_val_ddpm_text_T_vqganfin_oldcanvas.

IceClear avatar May 31 '24 12:05 IceClear

Hi. Sry for the late reply since I am quite busy recently. It seems like a size checking problem since the default tile size of sr_val_ddpm_text_T_vqganfin_oldcanvas_tile is 1280 and for images below 1280 we usually use sr_val_ddpm_text_T_vqganfin_oldcanvas w/o tiling. You may either adjust the default tiling size in sr_val_ddpm_text_T_vqganfin_oldcanvas_tile or try sr_val_ddpm_text_T_vqganfin_oldcanvas.

Thank you for your kind reply I will give it a try soon

zcdliuwei avatar Jun 03 '24 02:06 zcdliuwei