IceClear commited on
Commit
0d8f0d4
Β·
1 Parent(s): 076d301
Files changed (1) hide show
  1. app.py +88 -78
app.py CHANGED
@@ -395,84 +395,94 @@ def generation_loop(video_path='./test_videos', seed=666, fps_out=12, batch_size
395
  return output_dir, output_dir
396
 
397
 
398
- title = "SeedVR2: One-Step Video Restoration via Diffusion Adversarial Post-Training"
399
- description = r"""<center><img src='https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/assets/seedvr_logo.png' style='height:40px' alt='SeedVR logo'></center>
400
- <b>Official Gradio demo</b> for <a href='https://github.com/ByteDance-Seed/SeedVR' target='_blank'><b>SeedVR2: One-Step Video Restoration via Diffusion Adversarial Post-Training</b></a>.<br>
401
- πŸ”₯ SeedVR2 is a one-step image and video restoration algorithm for real-world and AIGC contents.<br>
402
- """
403
- article = r"""
404
- If SeedVR series are helpful, please help to ⭐ the <a href='https://github.com/ByteDance-Seed/SeedVR' target='_blank'>Github Repo</a>. Thanks!
405
- [![GitHub Stars](https://img.shields.io/github/stars/ByteDance-Seed/SeedVR?style=social)](https://github.com/ByteDance-Seed/SeedVR)
406
-
407
- ---
408
-
409
- πŸ“ **Notice:**
410
-
411
- To avoid OOM, this demo only support 720p video outputs within 121 frames. For other uses (e.g., image restoration, other resolutions, etc), please refer to the <a href='https://github.com/ByteDance-Seed/SeedVR' target='_blank'>Github Repo</a>.
412
-
413
-
414
- πŸ“ **Limitations:**
415
-
416
- These are the prototype models and the performance may not perfectly align with the paper. Our methods are sometimes not robust to heavy degradations and very large motions, and shares some failure cases with existing methods, e.g., fail to fully remove the degradation or simply generate unpleasing details. Moreover, due to the strong generation ability, Our methods tend to overly generate details on inputs with very light degradations, e.g., 720p AIGC videos, leading to oversharpened results occasionally.
417
-
418
-
419
- πŸ“ **Citation**
420
-
421
- If our work is useful for your research, please consider citing:
422
- ```bibtex
423
- @article{wang2025seedvr2,
424
- title={SeedVR2: One-Step Video Restoration via Diffusion Adversarial Post-Training},
425
- author={Wang, Jianyi and Lin, Shanchuan and Lin, Zhijie and Ren, Yuxi and Wei, Meng and Yue, Zongsheng and Zhou, Shangchen and Chen, Hao and Zhao, Yang and Yang, Ceyuan and Xiao, Xuefeng and Loy, Chen Change and Jiang, Lu},
426
- booktitle={arXiv preprint arXiv:2506.05301},
427
- year={2025}
428
- }
429
-
430
- @inproceedings{wang2025seedvr,
431
- title={SeedVR: Seeding Infinity in Diffusion Transformer Towards Generic Video Restoration},
432
- author={Wang, Jianyi and Lin, Zhijie and Wei, Meng and Zhao, Yang and Yang, Ceyuan and Loy, Chen Change and Jiang, Lu},
433
- booktitle={CVPR},
434
- year={2025}
435
- }
436
- ```
437
-
438
- πŸ“‹ **License**
439
-
440
- This project is licensed under <a rel="license" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
441
- Redistribution and use for non-commercial purposes should follow this license.
442
-
443
- πŸ“§ **Contact**
444
-
445
- If you have any questions, please feel free to reach me out at <b>[email protected]</b>.
446
-
447
- <div>
448
- πŸ€— Find Me:
449
- <a href="https://twitter.com/Iceclearwjy"><img style="margin-top:0.5em; margin-bottom:0.5em" src="https://img.shields.io/twitter/follow/Iceclearwjy?label=%40Iceclearwjy&style=social" alt="Twitter Follow"></a>
450
- <a href="https://github.com/IceClear"><img style="margin-top:0.5em; margin-bottom:2em" src="https://img.shields.io/github/followers/IceClear?style=social" alt="Github Follow"></a>
451
- </div>
452
-
453
- <center><img src='https://visitor-badge.laobi.icu/badge?page_id=ByteDance-Seed/SeedVR' alt='visitors'></center>
454
- """
455
-
456
- demo = gr.Interface(
457
- generation_loop, [
458
- gr.Video(
459
- label="Upload a video"
460
- ),
461
- gr.Number(label="Seeds"),
462
- gr.Number(label="fps"),
463
- ], [
464
- gr.Video(label="Output"),
465
- gr.File(label="Download the output")
466
- ],
467
- title=title,
468
- description=description,
469
- article=article,
470
- examples=[
471
- ['./01.mp4', 4, 24],
472
- ['./02.mp4', 4, 24],
473
- ['./03.mp4', 4, 24],
474
- ]
475
- )
 
 
 
 
 
 
 
 
 
 
476
 
477
  demo.queue()
478
  demo.launch()
 
395
  return output_dir, output_dir
396
 
397
 
398
+ with gr.Blocks(title="SeedVR2: One-Step Video Restoration via Diffusion Adversarial Post-Training") as demo:
399
+ # Top logo and title
400
+ gr.HTML("""
401
+ <div style='text-align:center; margin-bottom: 10px;'>
402
+ <img src='https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/assets/seedvr_logo.png' style='height:40px;' alt='SeedVR logo'/>
403
+ </div>
404
+ <p><b>Official Gradio demo</b> for
405
+ <a href='https://github.com/ByteDance-Seed/SeedVR' target='_blank'>
406
+ <b>SeedVR2: One-Step Video Restoration via Diffusion Adversarial Post-Training</b></a>.<br>
407
+ πŸ”₯ <b>SeedVR2</b> is a one-step image and video restoration algorithm for real-world and AIGC content.
408
+ </p>
409
+ """)
410
+
411
+ # Interface
412
+ with gr.Row():
413
+ input_video = gr.Video(label="Upload a video")
414
+ seed = gr.Number(label="Seeds")
415
+ fps = gr.Number(label="fps")
416
+
417
+ with gr.Row():
418
+ output_video = gr.Video(label="Output")
419
+ download_link = gr.File(label="Download the output")
420
+
421
+ run_button = gr.Button("Run")
422
+ run_button.click(fn=generation_loop, inputs=[input_video, seed, fps], outputs=[output_video, download_link])
423
+
424
+ # Examples
425
+ gr.Examples(
426
+ examples=[
427
+ ["./01.mp4", 4, 24],
428
+ ["./02.mp4", 4, 24],
429
+ ["./03.mp4", 4, 24],
430
+ ],
431
+ inputs=[input_video, seed, fps]
432
+ )
433
+
434
+ # Article/Footer
435
+ gr.HTML("""
436
+ <hr>
437
+ <p>If you find SeedVR helpful, please ⭐ the
438
+ <a href='https://github.com/ByteDance-Seed/SeedVR' target='_blank'>GitHub repository</a>:</p>
439
+
440
+ <a href="https://github.com/ByteDance-Seed/SeedVR" target="_blank">
441
+ <img src="https://img.shields.io/github/stars/ByteDance-Seed/SeedVR?style=social" alt="GitHub Stars">
442
+ </a>
443
+
444
+ <h4>Notice</h4>
445
+ <p>This demo supports up to <b>720p</b> and <b>121 frames</b>.
446
+ For other use cases, check the <a href='https://github.com/ByteDance-Seed/SeedVR' target='_blank'>GitHub repo</a>.</p>
447
+
448
+ <h4>Limitations</h4>
449
+ <p>May fail on heavy degradations or small-motion AIGC clips, causing oversharpening or poor restoration.</p>
450
+
451
+ <h4>Citation</h4>
452
+ <pre style="font-size: 12px;">
453
+ @article{wang2025seedvr2,
454
+ title={SeedVR2: One-Step Video Restoration via Diffusion Adversarial Post-Training},
455
+ author={Wang, Jianyi and ...},
456
+ booktitle={arXiv preprint arXiv:2506.05301},
457
+ year={2025}
458
+ }
459
+ @inproceedings{wang2025seedvr,
460
+ title={SeedVR: Seeding Infinity...},
461
+ booktitle={CVPR},
462
+ year={2025}
463
+ }
464
+ </pre>
465
+
466
+ <h4>License</h4>
467
+ <p>Licensed under the
468
+ <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache 2.0 License</a>.</p>
469
+
470
+ <h4>Contact</h4>
471
+ <p>Email: <b>iceclearwjy@gmail.com</b></p>
472
+
473
+ <p>
474
+ <a href="https://twitter.com/Iceclearwjy">
475
+ <img src="https://img.shields.io/twitter/follow/Iceclearwjy?label=%40Iceclearwjy&style=social" alt="Twitter Follow">
476
+ </a>
477
+ <a href="https://github.com/IceClear">
478
+ <img src="https://img.shields.io/github/followers/IceClear?style=social" alt="GitHub Follow">
479
+ </a>
480
+ </p>
481
+
482
+ <p style="text-align:center;">
483
+ <img src="https://visitor-badge.laobi.icu/badge?page_id=ByteDance-Seed/SeedVR" alt="visitors">
484
+ </p>
485
+ """)
486
 
487
  demo.queue()
488
  demo.launch()