Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,14 @@ import gradio as gr
|
|
2 |
import requests
|
3 |
import os
|
4 |
import gradio as gr
|
5 |
-
from
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
|
8 |
|
@@ -10,9 +17,6 @@ from transformers import pipeline
|
|
10 |
name = "andite/anything-v4.0"
|
11 |
model = gr.Interface.load(f"models/{name}")
|
12 |
|
13 |
-
pipe = pipeline("text-to-image",model=f"{name}")
|
14 |
-
pi = gr.Interface.from_pipeline(pipe)
|
15 |
-
|
16 |
|
17 |
o = os.getenv("P")
|
18 |
h = "Q"
|
@@ -23,7 +27,8 @@ def ac():
|
|
23 |
elif h != o:
|
24 |
return(None)
|
25 |
def im_pipe(put):
|
26 |
-
return
|
|
|
27 |
'''
|
28 |
num_images_per_prompt=n_images,
|
29 |
num_inference_steps = int(steps),
|
|
|
2 |
import requests
|
3 |
import os
|
4 |
import gradio as gr
|
5 |
+
from diffusers import StableDiffusionPipeline
|
6 |
+
import torch
|
7 |
+
|
8 |
+
model_id = "runwayml/stable-diffusion-v1-5"
|
9 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
10 |
+
pipe = pipe.to("cpu")
|
11 |
+
|
12 |
+
|
13 |
|
14 |
|
15 |
|
|
|
17 |
name = "andite/anything-v4.0"
|
18 |
model = gr.Interface.load(f"models/{name}")
|
19 |
|
|
|
|
|
|
|
20 |
|
21 |
o = os.getenv("P")
|
22 |
h = "Q"
|
|
|
27 |
elif h != o:
|
28 |
return(None)
|
29 |
def im_pipe(put):
|
30 |
+
return image = pipe(prompt, negative_prompt="blury").images[0]
|
31 |
+
|
32 |
'''
|
33 |
num_images_per_prompt=n_images,
|
34 |
num_inference_steps = int(steps),
|