Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,13 +4,10 @@ import torch
|
|
| 4 |
|
| 5 |
MODEL_ID = "hakurei/waifu-diffusion-v1-4"
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
MODEL_ID,
|
| 10 |
-
torch_dtype=torch.float16
|
| 11 |
-
)
|
| 12 |
-
pipe = pipe.to("cpu")
|
| 13 |
|
|
|
|
| 14 |
image = pipe(prompt, num_inference_steps=15).images[0]
|
| 15 |
return image
|
| 16 |
|
|
|
|
| 4 |
|
| 5 |
MODEL_ID = "hakurei/waifu-diffusion-v1-4"
|
| 6 |
|
| 7 |
+
pipe = StableDiffusionPipeline.from_pretrained(MODEL_ID)
|
| 8 |
+
pipe = pipe.to("cpu")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
def generate(prompt):
|
| 11 |
image = pipe(prompt, num_inference_steps=15).images[0]
|
| 12 |
return image
|
| 13 |
|