Spaces:
Sleeping
Sleeping
Commit
·
fddbcc2
1
Parent(s):
d659855
app.py
CHANGED
@@ -25,13 +25,13 @@ if not os.path.exists('architecture.jpg'):
|
|
25 |
if not os.path.exists('gray256.jpg'):
|
26 |
os.system('wget https://huggingface.co/JingyeChen22/textdiffuser2-full-ft/blob/main/gray256.jpg')
|
27 |
|
28 |
-
print(os.system('apt install mlocate'))
|
29 |
-
print(os.system('ls'))
|
30 |
-
print(os.system('pwd'))
|
31 |
-
print(os.system('locate gray256.jpg'))
|
32 |
-
# img = Image.open('locate gray256.jpg')
|
33 |
-
# print(img.size)
|
34 |
-
exit(0)
|
35 |
|
36 |
# #### import m1
|
37 |
# from fastchat.model import load_model, get_conversation_template
|
@@ -90,7 +90,7 @@ def exe_undo(i, t):
|
|
90 |
global state
|
91 |
state = 0
|
92 |
stack = []
|
93 |
-
image = Image.open(f'
|
94 |
print('stack', stack)
|
95 |
return image
|
96 |
|
@@ -101,7 +101,7 @@ def exe_redo(i, t):
|
|
101 |
|
102 |
if len(stack) > 0:
|
103 |
stack.pop()
|
104 |
-
image = Image.open(f'
|
105 |
draw = ImageDraw.Draw(image)
|
106 |
|
107 |
for items in stack:
|
@@ -149,7 +149,7 @@ def get_pixels(i, t, evt: gr.SelectData):
|
|
149 |
state = 0
|
150 |
|
151 |
|
152 |
-
image = Image.open(f'
|
153 |
draw = ImageDraw.Draw(image)
|
154 |
|
155 |
for items in stack:
|
@@ -371,7 +371,7 @@ with gr.Blocks() as demo:
|
|
371 |
# 这里加一个会话框
|
372 |
with gr.Row():
|
373 |
with gr.Column(scale=1):
|
374 |
-
i = gr.Image(label="Template", type='filepath', value=f'
|
375 |
with gr.Column(scale=3):
|
376 |
t = gr.Textbox(label="Template", placeholder='keyword')
|
377 |
redo = gr.Button(value='Redo - Cancel the last keyword') # 如何给b绑定事件
|
|
|
25 |
if not os.path.exists('gray256.jpg'):
|
26 |
os.system('wget https://huggingface.co/JingyeChen22/textdiffuser2-full-ft/blob/main/gray256.jpg')
|
27 |
|
28 |
+
# print(os.system('apt install mlocate'))
|
29 |
+
# print(os.system('ls'))
|
30 |
+
# print(os.system('pwd'))
|
31 |
+
# print(os.system('locate gray256.jpg'))
|
32 |
+
# # img = Image.open('locate gray256.jpg')
|
33 |
+
# # print(img.size)
|
34 |
+
# exit(0)
|
35 |
|
36 |
# #### import m1
|
37 |
# from fastchat.model import load_model, get_conversation_template
|
|
|
90 |
global state
|
91 |
state = 0
|
92 |
stack = []
|
93 |
+
image = Image.open(f'./gray256.jpg')
|
94 |
print('stack', stack)
|
95 |
return image
|
96 |
|
|
|
101 |
|
102 |
if len(stack) > 0:
|
103 |
stack.pop()
|
104 |
+
image = Image.open(f'./gray256.jpg')
|
105 |
draw = ImageDraw.Draw(image)
|
106 |
|
107 |
for items in stack:
|
|
|
149 |
state = 0
|
150 |
|
151 |
|
152 |
+
image = Image.open(f'./gray256.jpg')
|
153 |
draw = ImageDraw.Draw(image)
|
154 |
|
155 |
for items in stack:
|
|
|
371 |
# 这里加一个会话框
|
372 |
with gr.Row():
|
373 |
with gr.Column(scale=1):
|
374 |
+
i = gr.Image(label="Template", type='filepath', value=f'./gray256.jpg', height=256, width=256)
|
375 |
with gr.Column(scale=3):
|
376 |
t = gr.Textbox(label="Template", placeholder='keyword')
|
377 |
redo = gr.Button(value='Redo - Cancel the last keyword') # 如何给b绑定事件
|