Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
from semdiffusers import SemanticEditPipeline
|
4 |
|
5 |
-
device='
|
6 |
|
7 |
pipe = SemanticEditPipeline.from_pretrained(
|
8 |
"runwayml/stable-diffusion-v1-5",
|
9 |
).to(device)
|
10 |
|
11 |
def infer(prompt, seed):
|
12 |
-
gen =
|
13 |
-
gen.manual_seed(seed)
|
14 |
|
15 |
out = pipe(
|
16 |
prompt=prompt,
|
|
|
1 |
import gradio as gr
|
2 |
+
import tensorflow as tf
|
3 |
from semdiffusers import SemanticEditPipeline
|
4 |
|
5 |
+
device = 'gpu' if tf.config.list_physical_devices('GPU') else 'cpu'
|
6 |
|
7 |
pipe = SemanticEditPipeline.from_pretrained(
|
8 |
"runwayml/stable-diffusion-v1-5",
|
9 |
).to(device)
|
10 |
|
11 |
def infer(prompt, seed):
|
12 |
+
gen = tf.random.Generator.from_seed(seed)
|
|
|
13 |
|
14 |
out = pipe(
|
15 |
prompt=prompt,
|