Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,19 +2,8 @@ import gradio as gr
|
|
2 |
import requests
|
3 |
import os
|
4 |
|
5 |
-
user = "user1"
|
6 |
-
password = "pass1"
|
7 |
-
session = requests.Session()
|
8 |
-
session.auth = (user, password)
|
9 |
-
hostname = "huggingface.co/spaces/xp3857/text-to-image"
|
10 |
-
|
11 |
-
auth = session.post('http://' + hostname)
|
12 |
-
response = session.get('http://' + hostname + '/rest/applications')
|
13 |
-
print (auth)
|
14 |
-
print (response)
|
15 |
-
|
16 |
name = "runwayml/stable-diffusion-v1-5"
|
17 |
-
model = gr.Interface.load(f"models/{name}")
|
18 |
o = os.getenv("P")
|
19 |
h = "Q"
|
20 |
def ac(h=h):
|
@@ -22,6 +11,7 @@ def ac(h=h):
|
|
22 |
print(o)
|
23 |
if h == o:
|
24 |
def im_fn(put):
|
|
|
25 |
return model(put)
|
26 |
with gr.Blocks() as b:
|
27 |
put = gr.Textbox()
|
|
|
2 |
import requests
|
3 |
import os
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
name = "runwayml/stable-diffusion-v1-5"
|
6 |
+
model = gr.Interface.load(f"models/{name}",negative_prompt="blurry")
|
7 |
o = os.getenv("P")
|
8 |
h = "Q"
|
9 |
def ac(h=h):
|
|
|
11 |
print(o)
|
12 |
if h == o:
|
13 |
def im_fn(put):
|
14 |
+
|
15 |
return model(put)
|
16 |
with gr.Blocks() as b:
|
17 |
put = gr.Textbox()
|