Spaces:
Running
Running
CasualCodes
commited on
Commit
·
72137e7
1
Parent(s):
0ede22e
added diff.py (warning: too much memory from dependencies)
Browse files
diff.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
from diffusers import StableDiffusionPipeline
|
4 |
+
import torch
|
5 |
+
|
6 |
+
model_id = "runwayml/stable-diffusion-v1-5"
|
7 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
8 |
+
pipe = pipe.to("cuda")
|
9 |
+
|
10 |
+
def notation_2_note(input_text):
|
11 |
+
image = pipe(input_text).images[0]
|
12 |
+
return image
|
13 |
+
|
14 |
+
demo = gr.Interface(notation_2_note, "text", gr.Image())
|
15 |
+
demo.launch()
|
16 |
+
|
17 |
+
# No. Too much memory required
|