width & height parameters, prevent proper generation

#75
by shaybc - opened

when i use the width & height parameters with values other then 1024 the generated image doesn't make sense,
i also tried the target_size parameter and that didn't help,

i use it while calling the pipeline :

# create a pipeline
generator_pipe: StableDiffusionXLPipeline  = DiffusionPipeline.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    torch_dtype=torch.float16,
    use_safetensors=True,
    variant="fp16",
)

# move the pipeline to the GPU
generator_pipe.to("cuda")

# generate the image
generated_image = generator_pipe(
        prompt="Rick sanchez floating in space, 8k",
        negative_prompt="low res, blurry, extra fingers, extra limbs, duplicate",
        height=256,
        width=256,
        num_images_per_prompt=1,
        guidance_scale=7,
        num_inference_steps=25
    ).images[0]

here are some examples of what i got while generating 128x128, 256x256, or 512x512 images:

128x128:

20230822_005654_sanchez_space_0.png

256x256:

20230822_010853_sanchez_space_0.png

512x512:

20230822_012621_sanchez_space_0.png

Any ideas ?

I encountered the same problem, if the width and height are not 1024, the result is worse

The only solution i found is to generate 1024x1024 and using scale up or down to get the correct image resolution

The only solution i found is to generate 1024x1024 and using scale up or down to get the correct image resolution

and me

Sign up or log in to comment