diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

waifu-diffusion with AMD

Open EvgeniiLavrinov opened this issue 3 years ago • 2 comments

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

EvgeniiLavrinov avatar Oct 04 '22 15:10 EvgeniiLavrinov

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

s-show avatar Oct 09 '22 15:10 s-show

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

EvgeniiLavrinov avatar Oct 09 '22 15:10 EvgeniiLavrinov