zhuhz22 commited on
Commit
6e3438c
1 Parent(s): 7c0eba1
Files changed (1) hide show
  1. app.py +11 -13
app.py CHANGED
@@ -101,18 +101,18 @@ def infer(image, prompt, steps=50, cfg_scale=7.5, eta=1.0, fs=3, seed=123, ddpm_
101
 
102
 
103
  i2v_examples = [
104
- ['prompts/512/7.png', 'Donkeys in traditional attire gallop across a lush green meadow.', 50, 7.5, 1.0, 24, 123,900],
105
- ['prompts/512/41.png', 'Rabbits playing in a river.', 50, 7.5, 1.0, 24, 123,900],
106
- ['prompts/512/32.png', 'Mountains under the starlight.', 50, 7.5, 1.0, 24, 123,900],
107
- ['prompts/512/14.png', 'A duck swimming in the lake.', 50, 7.5, 1.0, 24, 123,900],
108
- ['prompts/512/30.png', 'A soldier riding a horse.', 50, 7.5, 1.0, 24, 123,900],
109
- ['prompts/512/52.png', 'Fireworks exploding in the sky.', 50, 7.5, 1.0, 24, 123,900],
110
  ]
111
 
112
 
113
 
114
 
115
- css = """#input_img {max-width: 1024px !important} #output_vid {max-width: 1024px; max-height: 576px}"""
116
 
117
  with gr.Blocks(analytics_enabled=False, css=css) as demo:
118
  gr.Markdown("<div align='center'> <h1> DynamiCrafter-CIL </span> </h1> \
@@ -124,13 +124,11 @@ with gr.Blocks(analytics_enabled=False, css=css) as demo:
124
  <a href='https://zhenxuan00.github.io/'> Chongxuan Li</a>,\
125
  <a href='https://ml.cs.tsinghua.edu.cn/~jun/software.shtml'>Jun Zhu</a>,\
126
  </h2> \
127
- <a style='font-size:18px;color: #000000'>If DynamiCrafter is useful, please help star the </a>\
128
  <a style='font-size:18px;color: #000000' href='https://github.com/thu-ml/cond-image-leakage/'>[Github Repo]</a>\
129
- <a style='font-size:18px;color: #000000'>, which is important to Open-Source projects. Thanks!</a>\
130
  <a style='font-size:18px;color: #000000' href='https://arxiv.org/abs/2406.15735'> [ArXiv] </a>\
131
  <a style='font-size:18px;color: #000000' href='https://cond-image-leak.github.io/'> [Project Page] </a> </div>")
132
 
133
- with gr.Tab(label='ImageAnimation_576x1024'):
134
  with gr.Column():
135
  with gr.Row():
136
  with gr.Column():
@@ -144,8 +142,8 @@ with gr.Blocks(analytics_enabled=False, css=css) as demo:
144
  i2v_cfg_scale = gr.Slider(minimum=1.0, maximum=15.0, step=0.5, label='CFG Scale', value=7.5, elem_id="i2v_cfg_scale")
145
  with gr.Row():
146
  i2v_steps = gr.Slider(minimum=1, maximum=50, step=1, elem_id="i2v_steps", label="Sampling steps", value=30)
147
- i2v_motion = gr.Slider(minimum=5, maximum=20, step=1, elem_id="i2v_motion", label="FPS", value=10)
148
- i2v_ddpm_from = gr.Slider(minimum=840, maximum=1000, step=1, elem_id="i2v_motion", label="ddpm_from", value=900)
149
 
150
  i2v_end_btn = gr.Button("Generate")
151
  # with gr.Tab(label='Result'):
@@ -153,7 +151,7 @@ with gr.Blocks(analytics_enabled=False, css=css) as demo:
153
  i2v_output_video = gr.Video(label="Generated Video",elem_id="output_vid",autoplay=True,show_share_button=True)
154
 
155
  gr.Examples(examples=i2v_examples,
156
- inputs=[i2v_input_image, i2v_input_text, i2v_steps, i2v_cfg_scale, i2v_eta, i2v_motion, i2v_seed],
157
  outputs=[i2v_output_video],
158
  fn = infer,
159
  cache_examples=True,
 
101
 
102
 
103
  i2v_examples = [
104
+ ['prompts/512/7.png', 'Donkeys in traditional attire gallop across a lush green meadow.', 50, 7.5, 1.0, 20, 123,900],
105
+ ['prompts/512/41.png', 'Rabbits playing in a river.', 50, 7.5, 1.0, 20, 123,900],
106
+ ['prompts/512/32.png', 'Mountains under the starlight.', 50, 7.5, 1.0, 20, 123,900],
107
+ ['prompts/512/14.png', 'A duck swimming in the lake.', 50, 7.5, 1.0, 20, 123,900],
108
+ ['prompts/512/30.png', 'A soldier riding a horse.', 50, 7.5, 1.0, 20, 123,900],
109
+ ['prompts/512/52.png', 'Fireworks exploding in the sky.', 50, 7.5, 1.0, 20, 123,900],
110
  ]
111
 
112
 
113
 
114
 
115
+ css = """#input_img {max-width: 512px !important} #output_vid {max-width: 512px; max-height: 320px}"""
116
 
117
  with gr.Blocks(analytics_enabled=False, css=css) as demo:
118
  gr.Markdown("<div align='center'> <h1> DynamiCrafter-CIL </span> </h1> \
 
124
  <a href='https://zhenxuan00.github.io/'> Chongxuan Li</a>,\
125
  <a href='https://ml.cs.tsinghua.edu.cn/~jun/software.shtml'>Jun Zhu</a>,\
126
  </h2> \
 
127
  <a style='font-size:18px;color: #000000' href='https://github.com/thu-ml/cond-image-leakage/'>[Github Repo]</a>\
 
128
  <a style='font-size:18px;color: #000000' href='https://arxiv.org/abs/2406.15735'> [ArXiv] </a>\
129
  <a style='font-size:18px;color: #000000' href='https://cond-image-leak.github.io/'> [Project Page] </a> </div>")
130
 
131
+ with gr.Tab(label='ImageAnimation_320x512'):
132
  with gr.Column():
133
  with gr.Row():
134
  with gr.Column():
 
142
  i2v_cfg_scale = gr.Slider(minimum=1.0, maximum=15.0, step=0.5, label='CFG Scale', value=7.5, elem_id="i2v_cfg_scale")
143
  with gr.Row():
144
  i2v_steps = gr.Slider(minimum=1, maximum=50, step=1, elem_id="i2v_steps", label="Sampling steps", value=30)
145
+ i2v_motion = gr.Slider(minimum=5, maximum=24, step=1, elem_id="i2v_motion", label="FPS", value=20)
146
+ i2v_ddpm_from = gr.Slider(minimum=840, maximum=1000, step=1, elem_id="i2v_ddpm_from", label="M", value=900)
147
 
148
  i2v_end_btn = gr.Button("Generate")
149
  # with gr.Tab(label='Result'):
 
151
  i2v_output_video = gr.Video(label="Generated Video",elem_id="output_vid",autoplay=True,show_share_button=True)
152
 
153
  gr.Examples(examples=i2v_examples,
154
+ inputs=[i2v_input_image, i2v_input_text, i2v_steps, i2v_cfg_scale, i2v_eta, i2v_motion, i2v_seed,i2v_ddpm_from],
155
  outputs=[i2v_output_video],
156
  fn = infer,
157
  cache_examples=True,