Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
@@ -1,26 +1,37 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
|
3 |
+
models =["CompVis/stable-diffusion-v1-4", "runwayml/stable-diffusion-v1-5", "stabilityai/stable-diffusion-2-1", "stabilityai/stable-diffusion-2-1-base"]
|
4 |
+
|
5 |
+
model_1=models[1]
|
6 |
+
model_2=models[2]
|
7 |
+
model_3=models[3]
|
8 |
+
model_4=models[4]
|
9 |
+
|
10 |
+
gr.Interface.load(f"models/{model_1}",live=False,preprocess=True, postprocess=False).launch()
|
11 |
+
|
12 |
+
|
13 |
+
#import diffusers
|
14 |
+
#import streamlit as st
|
15 |
+
#device = "cpu"
|
16 |
+
#from diffusers import StableDiffusionPipeline
|
17 |
+
#pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision = "fp16", use_auth_token = st.secrets["USER_TOKEN"])
|
18 |
+
#pipe = pipe.to("cpu")
|
19 |
+
#from PIL import Image
|
20 |
+
#import torch
|
21 |
+
#def StableDiffusionPipeline (prompt, Guide, iSteps, seed):
|
22 |
+
# generator = torch.Generator("cpu").manual_seed(seed)
|
23 |
+
# image = pipe(prompt, num_inference_steps = iSteps, guidence_scale = Guide).images[0]
|
24 |
+
# return image
|
25 |
+
#iface = gr.Interface(fn = StableDiffusionPipeline, inputs = [
|
26 |
+
# gr.Textbox(label = 'Prompt Input Text'),
|
27 |
+
# gr.Slider(2, 15, value = 7, label = 'Guidence Scale'),
|
28 |
+
# gr.Slider(10, 100, value = 25, step = 1, label = 'Number of Iterations'),
|
29 |
+
# gr.Slider(
|
30 |
+
# label = "Seed",
|
31 |
+
# minimum = 0,
|
32 |
+
# maximum = 2147483647,
|
33 |
+
# step = 1,
|
34 |
+
# randomize = True)
|
35 |
+
# ],
|
36 |
+
# outputs = 'image')
|
37 |
+
#iface.launch()
|