BestWishYsh commited on
Commit
c7b92cf
·
verified ·
1 Parent(s): e1525bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -163,11 +163,13 @@ def generate(
163
  image = ImageOps.exif_transpose(Image.fromarray(tensor))
164
 
165
  prompt = prompt.strip('"')
 
 
166
  if negative_prompt:
167
  negative_prompt = negative_prompt.strip('"')
168
 
169
- generator = torch.Generator(device).manual_seed(seed) if seed else None
170
-
171
  video_pt = pipe(
172
  prompt=prompt,
173
  negative_prompt=negative_prompt,
@@ -371,7 +373,7 @@ with gr.Blocks() as demo:
371
  batch_video_frames, seed = generate(
372
  prompt,
373
  image_input,
374
- negative_prompt=None,
375
  num_inference_steps=50,
376
  guidance_scale=7.0,
377
  seed=seed_value,
 
163
  image = ImageOps.exif_transpose(Image.fromarray(tensor))
164
 
165
  prompt = prompt.strip('"')
166
+ if len(negative_prompt) == 0:
167
+ negative_prompt = None
168
  if negative_prompt:
169
  negative_prompt = negative_prompt.strip('"')
170
 
171
+ generator = torch.Generator(device).manual_seed(seed) if seed else None
172
+
173
  video_pt = pipe(
174
  prompt=prompt,
175
  negative_prompt=negative_prompt,
 
373
  batch_video_frames, seed = generate(
374
  prompt,
375
  image_input,
376
+ negative_prompt=negative_prompt,
377
  num_inference_steps=50,
378
  guidance_scale=7.0,
379
  seed=seed_value,