Spaces:
Runtime error
Runtime error
minor changes to running the model
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
from diffusers import StableDiffusionPipeline
|
2 |
import torch
|
3 |
-
|
4 |
-
model_url = "https://huggingface.co/waifu-research-department/Rem" +
|
5 |
pipeline = StableDiffusionPipeline.from_single_file(
|
6 |
model_url,
|
7 |
torch_dtype=torch.float16,
|
@@ -48,22 +48,19 @@ image # your image is saved in this PIL variable
|
|
48 |
```
|
49 |
"""
|
50 |
|
51 |
-
|
52 |
-
log = "GPU available"
|
53 |
-
try :
|
54 |
pipeline.to("cuda")
|
55 |
-
except
|
56 |
log = "no GPU available"
|
57 |
|
58 |
|
59 |
def text2img(positive_prompt,negative_prompt):
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
return log,image
|
68 |
|
69 |
gr.Interface(text2img,["text","text"],["text","image"],examples=[["rem","3D"]],description=description).launch()
|
|
|
1 |
from diffusers import StableDiffusionPipeline
|
2 |
import torch
|
3 |
+
file_name = "/blob/main/rem_3k.ckpt"
|
4 |
+
model_url = "https://huggingface.co/waifu-research-department/Rem" + file_name
|
5 |
pipeline = StableDiffusionPipeline.from_single_file(
|
6 |
model_url,
|
7 |
torch_dtype=torch.float16,
|
|
|
48 |
```
|
49 |
"""
|
50 |
|
51 |
+
try :
|
|
|
|
|
52 |
pipeline.to("cuda")
|
53 |
+
except:
|
54 |
log = "no GPU available"
|
55 |
|
56 |
|
57 |
def text2img(positive_prompt,negative_prompt):
|
58 |
+
try :
|
59 |
+
image = pipeline(positive_prompt,negative_prompt=negative_prompt).images[0]
|
60 |
+
log = {"postive_prompt":positive_prompt,"negative_prompt":negative_prompt}
|
61 |
+
except Exception as e:
|
62 |
+
log = f"ERROR: {e}"
|
63 |
+
image = None
|
64 |
+
return log,image
|
|
|
65 |
|
66 |
gr.Interface(text2img,["text","text"],["text","image"],examples=[["rem","3D"]],description=description).launch()
|