Spaces:
Runtime error
Runtime error
Update app.py
Browse filestorch.get_default_dtype()
following discussion
https://discuss.huggingface.co/t/using-the-prompt-to-switch-model/30039/16
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from diffusers import StableDiffusionPipeline
|
2 |
import torch
|
3 |
import gradio as gr
|
|
|
4 |
|
5 |
models=[
|
6 |
"ItsJayQz/Marvel_WhatIf_Diffusion",
|
@@ -15,7 +16,7 @@ models=[
|
|
15 |
|
16 |
def TextToImage(Prompt,model):
|
17 |
model_id = model
|
18 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.
|
19 |
pipe = pipe.to("cpu")
|
20 |
prompt = Prompt
|
21 |
image = pipe(prompt).images[0]
|
|
|
1 |
from diffusers import StableDiffusionPipeline
|
2 |
import torch
|
3 |
import gradio as gr
|
4 |
+
import accelerate
|
5 |
|
6 |
models=[
|
7 |
"ItsJayQz/Marvel_WhatIf_Diffusion",
|
|
|
16 |
|
17 |
def TextToImage(Prompt,model):
|
18 |
model_id = model
|
19 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.get_default_dtype())
|
20 |
pipe = pipe.to("cpu")
|
21 |
prompt = Prompt
|
22 |
image = pipe(prompt).images[0]
|