Akjava commited on
Commit
b8a1ed1
·
1 Parent(s): 021871f

set max timeing-seat 32

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -38,7 +38,7 @@ css="""
38
 
39
 
40
  output_dir = "outputs"
41
- passed_time = 60 * 10
42
  def load_text(text_path: str) -> str:
43
  with open(text_path, 'r', encoding='utf-8') as f:
44
  text = f.read()
@@ -82,6 +82,7 @@ def process_images(normal_image,mouth_open_image,eye_close_image,duration=100,pa
82
  if duration<1:
83
  raise gr.Error("min duration is 1")
84
 
 
85
  if pattern == "":
86
  pattern = "nme"
87
  else:
@@ -101,7 +102,7 @@ def process_images(normal_image,mouth_open_image,eye_close_image,duration=100,pa
101
  frames.append(normal_image)
102
 
103
  loop = 0 if looping else 1 #MUST BE ZERO,NOT TRUE
104
- output_path = "tmp.webp"
105
  output_buffer = io.BytesIO()
106
  frames[0].save(output_buffer,
107
  save_all=True,
@@ -120,13 +121,8 @@ def process_images(normal_image,mouth_open_image,eye_close_image,duration=100,pa
120
  f.write(output_buffer.getvalue())
121
 
122
  return output_path
123
- #return image
124
-
125
 
126
- def show_example(value1,value2,valu3,id):
127
- return f"webpes/{id}.webp"
128
 
129
- #css=css,
130
 
131
  with gr.Blocks(css=css, elem_id="demo-container") as demo:
132
  with gr.Column():
@@ -146,7 +142,7 @@ with gr.Blocks(css=css, elem_id="demo-container") as demo:
146
  animation_time = gr.Number(value=100, minimum=1, maximum=1000, step=10, label="Animation Time")
147
  looping = gr.Checkbox(label="Loop",value=True)
148
  with gr.Row( equal_height=True):
149
- timing_seat = gr.Text(value="nnnmmmnenmmmnnnmmmnnnmmm", label="Timing Seat")
150
  with gr.Column():
151
  image_out = gr.Image(sources=[],label="Output", elem_id="output-img",type="filepath", format="webp")
152
 
 
38
 
39
 
40
  output_dir = "outputs"
41
+ passed_time = 60 * 20
42
  def load_text(text_path: str) -> str:
43
  with open(text_path, 'r', encoding='utf-8') as f:
44
  text = f.read()
 
82
  if duration<1:
83
  raise gr.Error("min duration is 1")
84
 
85
+ pattern = pattern[:32]
86
  if pattern == "":
87
  pattern = "nme"
88
  else:
 
102
  frames.append(normal_image)
103
 
104
  loop = 0 if looping else 1 #MUST BE ZERO,NOT TRUE
105
+
106
  output_buffer = io.BytesIO()
107
  frames[0].save(output_buffer,
108
  save_all=True,
 
121
  f.write(output_buffer.getvalue())
122
 
123
  return output_path
 
 
124
 
 
 
125
 
 
126
 
127
  with gr.Blocks(css=css, elem_id="demo-container") as demo:
128
  with gr.Column():
 
142
  animation_time = gr.Number(value=100, minimum=1, maximum=1000, step=10, label="Animation Time")
143
  looping = gr.Checkbox(label="Loop",value=True)
144
  with gr.Row( equal_height=True):
145
+ timing_seat = gr.Text(value="nnnmmmnenmmmnnnmmmnnnmmm", max_length=32,label="Timing Seat")
146
  with gr.Column():
147
  image_out = gr.Image(sources=[],label="Output", elem_id="output-img",type="filepath", format="webp")
148