Spaces:
Running
Running
fix interactive and header
Browse files
app.py
CHANGED
@@ -121,7 +121,7 @@ def main():
|
|
121 |
cfg_scale = gr.Slider(value=0.5, minimum=0.0, maximum=1.0, step=0.1, label="Edit/Text Strength (CFG)", interactive=True)
|
122 |
|
123 |
with gr.Row():
|
124 |
-
input_image = gr.Image(label="Input Image", type="pil", interactive=
|
125 |
height=resolution, width=resolution)
|
126 |
edited_image = gr.Image(label="Edited Image", type="pil", interactive=False,
|
127 |
height=resolution, width=resolution)
|
|
|
121 |
cfg_scale = gr.Slider(value=0.5, minimum=0.0, maximum=1.0, step=0.1, label="Edit/Text Strength (CFG)", interactive=True)
|
122 |
|
123 |
with gr.Row():
|
124 |
+
input_image = gr.Image(label="Input Image", type="pil", interactive=True,
|
125 |
height=resolution, width=resolution)
|
126 |
edited_image = gr.Image(label="Edited Image", type="pil", interactive=False,
|
127 |
height=resolution, width=resolution)
|
caller.py
CHANGED
@@ -18,11 +18,6 @@ from loguru import logger
|
|
18 |
# 接口 URL
|
19 |
t2i_url = 'https://magicarena.bytedance.com/api/evaluate/v1/algo/process'
|
20 |
|
21 |
-
#注意:正式上线环境需要不设置header
|
22 |
-
headers = {
|
23 |
-
'X-TT-ENV': 'ppe_general_20',
|
24 |
-
'X-USE-PPE': '1'
|
25 |
-
}
|
26 |
|
27 |
APP_KEY = os.environ['APP_KEY']
|
28 |
SECRET_KEY = os.environ["SECRET_KEY"]
|
@@ -69,7 +64,6 @@ class SeedT2ICaller():
|
|
69 |
# 请求发送
|
70 |
response = requests.post(
|
71 |
t2i_url,
|
72 |
-
headers=headers,
|
73 |
data=json.dumps({
|
74 |
'AlgoType': 1,
|
75 |
'ReqJson': req_json,
|
@@ -115,7 +109,6 @@ class SeedEditCaller():
|
|
115 |
# 请求发送
|
116 |
response = requests.post(
|
117 |
t2i_url,
|
118 |
-
headers=headers,
|
119 |
data=json.dumps({
|
120 |
'AlgoType': 2,
|
121 |
'ReqJson': req_json,
|
|
|
18 |
# 接口 URL
|
19 |
t2i_url = 'https://magicarena.bytedance.com/api/evaluate/v1/algo/process'
|
20 |
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
APP_KEY = os.environ['APP_KEY']
|
23 |
SECRET_KEY = os.environ["SECRET_KEY"]
|
|
|
64 |
# 请求发送
|
65 |
response = requests.post(
|
66 |
t2i_url,
|
|
|
67 |
data=json.dumps({
|
68 |
'AlgoType': 1,
|
69 |
'ReqJson': req_json,
|
|
|
109 |
# 请求发送
|
110 |
response = requests.post(
|
111 |
t2i_url,
|
|
|
112 |
data=json.dumps({
|
113 |
'AlgoType': 2,
|
114 |
'ReqJson': req_json,
|