Fabrice-TIERCELIN commited on
Commit
85840ec
·
verified ·
1 Parent(s): 69860ff

Merge interface

Browse files
Files changed (1) hide show
  1. app.py +27 -10
app.py CHANGED
@@ -544,13 +544,13 @@ def process(input_image, prompt,
544
  seed = random.randint(0, np.iinfo(np.int32).max)
545
 
546
  prompts = prompt.split(";")
547
-
548
  # assert input_image is not None, 'No input image!'
549
  if t2v:
550
  default_height, default_width = 640, 640
551
  input_image = np.ones((default_height, default_width, 3), dtype=np.uint8) * 255
552
  print("No input image provided. Using a blank white image.")
553
-
554
  yield None, None, '', '', gr.update(interactive=False), gr.update(interactive=True)
555
 
556
  stream = AsyncStream()
@@ -907,7 +907,7 @@ with block:
907
  with gr.Row():
908
  gr.HTML("""
909
  <p style="background-color: red;"><big><big><big><b>⚠️To use FramePack, <a href="https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR?duplicate=true">duplicate this space</a> and set a GPU with 30 GB VRAM.</b>
910
-
911
  You can't use FramePack directly here because this space runs on a CPU, which is not enough for FramePack. Please provide <a href="https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR/discussions/new">feedback</a> if you have issues.
912
  </big></big></big></p>
913
  """)
@@ -940,15 +940,32 @@ adapted from the official code repo [FramePack](https://github.com/lllyasviel/Fr
940
  randomize_seed = gr.Checkbox(label='Randomize seed', value=True, info='If checked, the seed is always different')
941
  seed = gr.Slider(label="Seed", minimum=0, maximum=np.iinfo(np.int32).max, step=1, randomize=True)
942
 
943
- latent_window_size = gr.Slider(label="Latent Window Size", minimum=1, maximum=33, value=9, step=1) # Should not change
944
- steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=25, step=1, info='Changing this value is not recommended.')
945
-
946
- cfg = gr.Slider(label="CFG Scale", minimum=1.0, maximum=32.0, value=1.0, step=0.01) # Should not change
947
- gs = gr.Slider(label="Distilled CFG Scale", minimum=1.0, maximum=32.0, value=10.0, step=0.01, info='Changing this value is not recommended; 3=blurred motions& & unsharped; 10 focus motion')
 
 
 
 
948
  rs = gr.Slider(label="CFG Re-Scale", minimum=0.0, maximum=1.0, value=0.0, step=0.01) # Should not change
949
-
 
 
 
 
 
 
 
 
 
 
 
 
 
950
  gpu_memory_preservation = gr.Slider(label="GPU Inference Preserved Memory (GB) (larger means slower)", minimum=6, maximum=128, value=6, step=0.1, info="Set this number to a larger value if you encounter OOM. Larger value causes slower speed.")
951
-
952
  mp4_crf = gr.Slider(label="MP4 Compression", minimum=0, maximum=100, value=16, step=1, info="Lower means better quality. 0 is uncompressed. Change to 16 if you get black outputs. ")
953
 
954
  with gr.Accordion("Debug", open=False):
 
544
  seed = random.randint(0, np.iinfo(np.int32).max)
545
 
546
  prompts = prompt.split(";")
547
+
548
  # assert input_image is not None, 'No input image!'
549
  if t2v:
550
  default_height, default_width = 640, 640
551
  input_image = np.ones((default_height, default_width, 3), dtype=np.uint8) * 255
552
  print("No input image provided. Using a blank white image.")
553
+
554
  yield None, None, '', '', gr.update(interactive=False), gr.update(interactive=True)
555
 
556
  stream = AsyncStream()
 
907
  with gr.Row():
908
  gr.HTML("""
909
  <p style="background-color: red;"><big><big><big><b>⚠️To use FramePack, <a href="https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR?duplicate=true">duplicate this space</a> and set a GPU with 30 GB VRAM.</b>
910
+
911
  You can't use FramePack directly here because this space runs on a CPU, which is not enough for FramePack. Please provide <a href="https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR/discussions/new">feedback</a> if you have issues.
912
  </big></big></big></p>
913
  """)
 
940
  randomize_seed = gr.Checkbox(label='Randomize seed', value=True, info='If checked, the seed is always different')
941
  seed = gr.Slider(label="Seed", minimum=0, maximum=np.iinfo(np.int32).max, step=1, randomize=True)
942
 
943
+ latent_window_size = gr.Slider(label="Latent Window Size", minimum=1, maximum=33, value=9, step=1, info='Generate more frames at a time (larger chunks). Less degradation and better blending but higher VRAM cost. Should not change.')
944
+ steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=25, step=1, info='Increase for more quality, especially if using high non-distilled CFG. Changing this value is not recommended.')
945
+ batch = gr.Slider(label="Batch Size (Number of Videos)", minimum=1, maximum=1000, value=1, step=1, info='Generate multiple videos each with a different seed (only for video extension).')
946
+
947
+ resolution = gr.Number(label="Resolution (max width or height)", value=640, precision=0, info='Only for video extension')
948
+
949
+ # 20250506 pftq: Reduced default distilled guidance scale to improve adherence to input video
950
+ cfg = gr.Slider(label="CFG Scale", minimum=1.0, maximum=32.0, value=1.0, step=0.01, info='Use this instead of Distilled for more detail/control + Negative Prompt (make sure Distilled set to 1). Doubles render time. Should not change.')
951
+ gs = gr.Slider(label="Distilled CFG Scale", minimum=1.0, maximum=32.0, value=10.0, step=0.01, info='Prompt adherence at the cost of less details from the input video, but to a lesser extent than Context Frames; 3=blurred motions& & unsharped, 10=focus motion; changing this value is not recommended')
952
  rs = gr.Slider(label="CFG Re-Scale", minimum=0.0, maximum=1.0, value=0.0, step=0.01) # Should not change
953
+
954
+
955
+ # 20250506 pftq: Renamed slider to Number of Context Frames and updated description
956
+ num_clean_frames = gr.Slider(label="Number of Context Frames", minimum=2, maximum=10, value=5, step=1, info="Retain more video details but increase memory use. Reduce to 2 if memory issues (only for video extension).")
957
+
958
+ default_vae = 32
959
+ if high_vram:
960
+ default_vae = 128
961
+ elif free_mem_gb>=20:
962
+ default_vae = 64
963
+
964
+ vae_batch = gr.Slider(label="VAE Batch Size for Input Video", minimum=4, maximum=256, value=default_vae, step=4, info="Reduce if running out of memory. Increase for better quality frames during fast motion (only for video extension).")
965
+
966
+
967
  gpu_memory_preservation = gr.Slider(label="GPU Inference Preserved Memory (GB) (larger means slower)", minimum=6, maximum=128, value=6, step=0.1, info="Set this number to a larger value if you encounter OOM. Larger value causes slower speed.")
968
+
969
  mp4_crf = gr.Slider(label="MP4 Compression", minimum=0, maximum=100, value=16, step=1, info="Lower means better quality. 0 is uncompressed. Change to 16 if you get black outputs. ")
970
 
971
  with gr.Accordion("Debug", open=False):