Make CPU inference as default
@@ -98,20 +98,20 @@ import torch
model_id = "nezha_output"
-# use gpu
-pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")
+# use cpu (FP32 by default; low precision coming soon)
+pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float)
-# use cpu
-# pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float)
+# use gpu
+#pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")
prompt = "a graffiti in a wall with a nezha on it"
image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
-image.save("./generated_images/graffiti.png")
+image.save("./graffiti.png")
```
-one of the inference result shows below:
+Here is a sample image generated by the fine-tuned model:
![nezha](./generated_images/graffiti.png)
