stable-diffusion icon indicating copy to clipboard operation
stable-diffusion copied to clipboard

img2img.py custom dimensions

Open jayhxmo opened this issue 2 years ago • 2 comments

Is it possible to have a non 1:1 aspect ratio image for img2img.py? (For both input & output). I notice this is possible in txt2img.py.

Currently if I try it, I get this error:

RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.cuda.HalfTensor) should be the same

jayhxmo avatar Sep 12 '22 00:09 jayhxmo

that's probably a problem with the half mode, never tested it on img2img. You can remove the model.half() line from img2img.py to fix that. I'll take a look at it this weekend

Doggettx avatar Sep 16 '22 07:09 Doggettx

@Doggettx
Needed to comment out the below the lines:

torch.set_default_tensor_type(torch.HalfTensor) model = model.half()

in img2.img.py to get it working.

JacobMarley avatar Sep 28 '22 16:09 JacobMarley