harishanand95 / diffusers

AMD ONNX port of 🤗 Diffusers: State-of-the-art diffusion models
Apache License 2.0
58 stars 16 forks source link

waifu-diffusion with AMD #7

Open EvgeniiLavrinov opened 1 year ago

EvgeniiLavrinov commented 1 year ago

Is it possible to change the model to waifu-diffusion? I did not find guides to work with amd cards.

s-show commented 1 year ago

I was able to use the waifu-diffusion model with the following code.

pipe = StableDiffusionPipeline.from_pretrained("hakurei/waifu-diffusion", torch_dtype=torch.float16)

pipe.safety_checker = lambda images, **kwargs: (images, False)

prompt = "1girl, \
blue eyes, \
cat ears, \
full body, \
looking at viewer, \
school uniform, \
simple background, \
silver long hair, \
under rim eyewear, \
white background"

image = pipe(prompt, height=512, width=512, num_inference_steps=50, guidance_scale=7.5, eta=0.0, execution_provider="DmlExecutionProvider")["sample"][0]
image.save("Dml_waifu1.png")

Generate image. (The image is corrupted because I did not adjust the prompts, etc. Dml_waifu1

EvgeniiLavrinov commented 1 year ago

Thanks for the answer. Just recently I found a build that launches webui (allows you to use a negative prompt) but without using the GPU. It's a pity that the CPU is slow in this process. Now I'm looking for the possibility to launch webui using rx5700 (this card is somehow used in dml_onnx). Maybe someone already has similar developments? best