Spaces:
Runtime error
Runtime error
Commit
·
0c86f09
1
Parent(s):
1ceda1a
update html and example code
Browse files- app_fatezero.py +76 -3
app_fatezero.py
CHANGED
|
@@ -25,14 +25,85 @@ from inference_fatezero import merge_config_then_run
|
|
| 25 |
# return base_model, training_prompt
|
| 26 |
|
| 27 |
|
| 28 |
-
TITLE = '# [FateZero](http://fate-zero-edit.github.io/)'
|
| 29 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
| 30 |
# pipe = InferencePipeline(HF_TOKEN)
|
| 31 |
-
pipe = merge_config_then_run
|
| 32 |
# app = InferenceUtil(HF_TOKEN)
|
| 33 |
|
| 34 |
with gr.Blocks(css='style.css') as demo:
|
| 35 |
-
gr.Markdown(TITLE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
with gr.Row():
|
| 38 |
with gr.Column():
|
|
@@ -213,6 +284,8 @@ with gr.Blocks(css='style.css') as demo:
|
|
| 213 |
enhance_words_value,
|
| 214 |
num_steps,
|
| 215 |
guidance_scale,
|
|
|
|
|
|
|
| 216 |
],
|
| 217 |
outputs=result,
|
| 218 |
fn=merge_config_then_run,
|
|
|
|
| 25 |
# return base_model, training_prompt
|
| 26 |
|
| 27 |
|
| 28 |
+
# TITLE = '# [FateZero](http://fate-zero-edit.github.io/)'
|
| 29 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
| 30 |
# pipe = InferencePipeline(HF_TOKEN)
|
| 31 |
+
# pipe = merge_config_then_run
|
| 32 |
# app = InferenceUtil(HF_TOKEN)
|
| 33 |
|
| 34 |
with gr.Blocks(css='style.css') as demo:
|
| 35 |
+
# gr.Markdown(TITLE)
|
| 36 |
+
gr.HTML(
|
| 37 |
+
"""
|
| 38 |
+
<div style="text-align: center; max-width: 1200px; margin: 20px auto;">
|
| 39 |
+
<h1 style="font-weight: 900; font-size: 3rem; margin: 0rem">
|
| 40 |
+
FateZero : Fusing Attentions for Zero-shot Text-based Video Editing
|
| 41 |
+
</h1>
|
| 42 |
+
<h2 style="font-weight: 450; font-size: 1rem; margin: 0rem">
|
| 43 |
+
<a href="https://chenyangqiqi.github.io/">Chenyang Qi</a>
|
| 44 |
+
<a href="https://vinthony.github.io/academic/">Xiaodong Cun</a> , <a href="https://yzhang2016.github.io/">Yong Zhang</a>,
|
| 45 |
+
<a href="https://chenyanglei.github.io">Chenyang Lei</a>, <a href="https://xinntao.github.io/"> Xintao Wang </a>,
|
| 46 |
+
<a href="https://scholar.google.com/citations?user=4oXBp9UAAAAJ&hl=zh-CN">Ying Shan</a>,
|
| 47 |
+
<a href="http://cqf.io">Qifeng Chen</a>
|
| 48 |
+
</h2>
|
| 49 |
+
|
| 50 |
+
<h2 style="font-weight: 450; font-size: 1rem; margin: 0rem">
|
| 51 |
+
<span class="link-block">
|
| 52 |
+
[<a href="https://arxiv.org/abs/2303.09535" target="_blank"
|
| 53 |
+
class="external-link ">
|
| 54 |
+
<span class="icon">
|
| 55 |
+
<i class="ai ai-arxiv"></i>
|
| 56 |
+
</span>
|
| 57 |
+
<span>arXiv</span>
|
| 58 |
+
</a>]
|
| 59 |
+
</span>
|
| 60 |
+
|
| 61 |
+
<!-- Github link -->
|
| 62 |
+
<span class="link-block">
|
| 63 |
+
[<a href="https://github.com/ChenyangQiQi/FateZero" target="_blank"
|
| 64 |
+
class="external-link ">
|
| 65 |
+
<span class="icon">
|
| 66 |
+
<i class="fab fa-github"></i>
|
| 67 |
+
</span>
|
| 68 |
+
<span>Code</span>
|
| 69 |
+
</a>]
|
| 70 |
+
</span>
|
| 71 |
+
|
| 72 |
+
<!-- Github link -->
|
| 73 |
+
<span class="link-block">
|
| 74 |
+
[<a href="http://fate-zero-edit.github.io/" target="_blank"
|
| 75 |
+
class="external-link ">
|
| 76 |
+
<span class="icon">
|
| 77 |
+
<i class="fab fa-github"></i>
|
| 78 |
+
</span>
|
| 79 |
+
<span>Homepage</span>
|
| 80 |
+
</a>]
|
| 81 |
+
</span>
|
| 82 |
+
|
| 83 |
+
<!-- Github link -->
|
| 84 |
+
<span class="link-block">
|
| 85 |
+
[<a href="https://hkustconnect-my.sharepoint.com/:v:/g/personal/cqiaa_connect_ust_hk/EXKDI_nahEhKtiYPvvyU9SkBDTG2W4G1AZ_vkC7ekh3ENw?e=ficp9t" target="_blank"
|
| 86 |
+
class="external-link ">
|
| 87 |
+
<span class="icon">
|
| 88 |
+
<i class="fab fa-youtube"></i>
|
| 89 |
+
</span>
|
| 90 |
+
<span>Video</span>
|
| 91 |
+
</a>]
|
| 92 |
+
</span>
|
| 93 |
+
</h2>
|
| 94 |
+
<h2 style="font-weight: 450; font-size: 1rem; margin-top: 0.5rem; margin-bottom: 0.5rem">
|
| 95 |
+
FateZero is a first zero-shot framework for text-driven video editing via pretrained diffusion models without training.
|
| 96 |
+
</h2>
|
| 97 |
+
</div>
|
| 98 |
+
""")
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
gr.HTML("""
|
| 102 |
+
<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings.
|
| 103 |
+
<br/>
|
| 104 |
+
<a href="https://huggingface.co/spaces/chenyangqi/FateZero?duplicate=true">
|
| 105 |
+
<img style="margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
|
| 106 |
+
</p>""")
|
| 107 |
|
| 108 |
with gr.Row():
|
| 109 |
with gr.Column():
|
|
|
|
| 284 |
enhance_words_value,
|
| 285 |
num_steps,
|
| 286 |
guidance_scale,
|
| 287 |
+
user_input_video,
|
| 288 |
+
*ImageSequenceDataset_list
|
| 289 |
],
|
| 290 |
outputs=result,
|
| 291 |
fn=merge_config_then_run,
|