Anonymous commited on
Commit
ce7f56c
1 Parent(s): ecc18cb
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -28,8 +28,7 @@ os.makedirs(ckpt_dir_256, exist_ok=True)
28
  hf_hub_download(repo_id="MoonQiu/LongerCrafter", filename="model.pth", local_dir=ckpt_dir_256)
29
 
30
 
31
- def infer(prompt):
32
- output_size = "256x256"
33
  num_frames = 32
34
  ddim_steps = 50
35
  unconditional_guidance_scale = 12.0
@@ -159,13 +158,12 @@ def infer(prompt):
159
  examples = [
160
  "A chihuahua in astronaut suit floating in space, cinematic lighting, glow effect",
161
  "Campfire at night in a snowy forest with starry sky in the background",
162
- "A dark knight riding a black horse on the grassland, in sunset",
163
  "A corgi is swimming quickly",
164
  "A panda is surfing in the universe",
165
  ]
166
 
167
  css = """
168
- #col-container {max-width: 510px; margin-left: auto; margin-right: auto;}
169
  a {text-decoration-line: underline; font-weight: 600;}
170
  .animate-spin {
171
  animation: spin 1s linear infinite;
@@ -259,15 +257,14 @@ with gr.Blocks(css=css) as demo:
259
  )
260
 
261
  prompt_in = gr.Textbox(label="Prompt", placeholder="A chihuahua in astronaut suit floating in space, cinematic lighting, glow effect", elem_id="prompt-in")
262
- #neg_prompt = gr.Textbox(label="Negative prompt", value="text, watermark, copyright, blurry, nsfw", elem_id="neg-prompt-in")
263
- #inference_steps = gr.Slider(label="Inference Steps", minimum=10, maximum=100, step=1, value=40, interactive=False)
264
  submit_btn = gr.Button("Generate")
265
  video_result = gr.Video(label="Video Output", elem_id="video-output")
266
 
267
  gr.Examples(examples=examples, inputs=[prompt_in])
268
 
269
  submit_btn.click(fn=infer,
270
- inputs=[prompt_in],
271
  outputs=[video_result],
272
  api_name="zrscp")
273
 
 
28
  hf_hub_download(repo_id="MoonQiu/LongerCrafter", filename="model.pth", local_dir=ckpt_dir_256)
29
 
30
 
31
+ def infer(prompt, output_size):
 
32
  num_frames = 32
33
  ddim_steps = 50
34
  unconditional_guidance_scale = 12.0
 
158
  examples = [
159
  "A chihuahua in astronaut suit floating in space, cinematic lighting, glow effect",
160
  "Campfire at night in a snowy forest with starry sky in the background",
 
161
  "A corgi is swimming quickly",
162
  "A panda is surfing in the universe",
163
  ]
164
 
165
  css = """
166
+ #col-container {max-width: 640px; margin-left: auto; margin-right: auto;}
167
  a {text-decoration-line: underline; font-weight: 600;}
168
  .animate-spin {
169
  animation: spin 1s linear infinite;
 
257
  )
258
 
259
  prompt_in = gr.Textbox(label="Prompt", placeholder="A chihuahua in astronaut suit floating in space, cinematic lighting, glow effect", elem_id="prompt-in")
260
+ output_size = gr.Radio(["576x1024", "256x256"], label="Output Size", info="576x1024 is watermark-free"),
 
261
  submit_btn = gr.Button("Generate")
262
  video_result = gr.Video(label="Video Output", elem_id="video-output")
263
 
264
  gr.Examples(examples=examples, inputs=[prompt_in])
265
 
266
  submit_btn.click(fn=infer,
267
+ inputs=[prompt_in, output_size],
268
  outputs=[video_result],
269
  api_name="zrscp")
270