Spaces:
Running
Running
Update app_df.py
Browse files
app_df.py
CHANGED
@@ -11,6 +11,8 @@ from skyreels_v2_infer import DiffusionForcingPipeline
|
|
11 |
from skyreels_v2_infer.modules import download_model
|
12 |
from skyreels_v2_infer.pipelines import PromptEnhancer, resizecrop
|
13 |
|
|
|
|
|
14 |
def generate_diffusion_forced_video(
|
15 |
prompt,
|
16 |
model_id,
|
@@ -33,7 +35,8 @@ def generate_diffusion_forced_video(
|
|
33 |
prompt_enhancer=False,
|
34 |
teacache=False,
|
35 |
teacache_thresh=0.2,
|
36 |
-
use_ret_steps=False
|
|
|
37 |
):
|
38 |
model_id = download_model(model_id)
|
39 |
|
@@ -60,7 +63,7 @@ def generate_diffusion_forced_video(
|
|
60 |
height, width = width, height
|
61 |
image = resizecrop(image, height, width)
|
62 |
|
63 |
-
negative_prompt = "
|
64 |
|
65 |
prompt_input = prompt
|
66 |
if prompt_enhancer and image is None:
|
@@ -130,9 +133,22 @@ model_options = ["Skywork/SkyReels-V2-DF-1.3B-540P"] # Update if there are more
|
|
130 |
|
131 |
with gr.Blocks() as demo:
|
132 |
with gr.Column():
|
133 |
-
gr.Markdown("# SkyReels V2")
|
134 |
-
gr.Markdown("
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
with gr.Row():
|
137 |
|
138 |
with gr.Column():
|
@@ -185,25 +201,35 @@ with gr.Blocks() as demo:
|
|
185 |
def set_num_frames(target_l):
|
186 |
|
187 |
n_frames = 0
|
|
|
|
|
188 |
|
189 |
if target_l == "4":
|
190 |
n_frames = 97
|
191 |
elif target_l == "10":
|
192 |
n_frames = 257
|
|
|
|
|
193 |
elif target_l == "15":
|
194 |
n_frames = 377
|
|
|
|
|
195 |
elif target_l == "30":
|
196 |
n_frames = 737
|
|
|
|
|
197 |
elif target_l == "60":
|
198 |
n_frames = 1457
|
|
|
|
|
199 |
|
200 |
-
return n_frames
|
201 |
|
202 |
|
203 |
target_length.change(
|
204 |
fn = set_num_frames,
|
205 |
inputs = [target_length],
|
206 |
-
outputs = [num_frames],
|
207 |
queue = False
|
208 |
)
|
209 |
|
|
|
11 |
from skyreels_v2_infer.modules import download_model
|
12 |
from skyreels_v2_infer.pipelines import PromptEnhancer, resizecrop
|
13 |
|
14 |
+
is_shared_ui = True if "fffiloni/SkyReels-V2" in os.environ['SPACE_ID'] else False
|
15 |
+
|
16 |
def generate_diffusion_forced_video(
|
17 |
prompt,
|
18 |
model_id,
|
|
|
35 |
prompt_enhancer=False,
|
36 |
teacache=False,
|
37 |
teacache_thresh=0.2,
|
38 |
+
use_ret_steps=False,
|
39 |
+
progress=gr.Progress(track_tqdm=True)
|
40 |
):
|
41 |
model_id = download_model(model_id)
|
42 |
|
|
|
63 |
height, width = width, height
|
64 |
image = resizecrop(image, height, width)
|
65 |
|
66 |
+
negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"
|
67 |
|
68 |
prompt_input = prompt
|
69 |
if prompt_enhancer and image is None:
|
|
|
133 |
|
134 |
with gr.Blocks() as demo:
|
135 |
with gr.Column():
|
136 |
+
gr.Markdown("# SkyReels V2: Infinite-Length Film Generation")
|
137 |
+
gr.Markdown("The first open-source video generative model employing AutoRegressive Diffusion-Forcing architecture that achieves the SOTA performance among publicly available models.")
|
138 |
|
139 |
+
gr.HTML("""
|
140 |
+
<div style="display:flex;column-gap:4px;">
|
141 |
+
<a href="https://github.com/SkyworkAI/SkyReels-V2">
|
142 |
+
<img src='https://img.shields.io/badge/GitHub-Repo-blue'>
|
143 |
+
</a>
|
144 |
+
<a href="https://arxiv.org/pdf/2504.13074">
|
145 |
+
<img src='https://img.shields.io/badge/ArXiv-Paper-red'>
|
146 |
+
</a>
|
147 |
+
<a href="https://huggingface.co/spaces/fffiloni/SkyReels-V2?duplicate=true">
|
148 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-sm.svg" alt="Duplicate this Space">
|
149 |
+
</a>
|
150 |
+
</div>
|
151 |
+
""")
|
152 |
with gr.Row():
|
153 |
|
154 |
with gr.Column():
|
|
|
201 |
def set_num_frames(target_l):
|
202 |
|
203 |
n_frames = 0
|
204 |
+
overlap_history = 0
|
205 |
+
addnoise_condition = 0
|
206 |
|
207 |
if target_l == "4":
|
208 |
n_frames = 97
|
209 |
elif target_l == "10":
|
210 |
n_frames = 257
|
211 |
+
overlap_history = 17
|
212 |
+
addnoise_condition = 20
|
213 |
elif target_l == "15":
|
214 |
n_frames = 377
|
215 |
+
overlap_history = 17
|
216 |
+
addnoise_condition = 20
|
217 |
elif target_l == "30":
|
218 |
n_frames = 737
|
219 |
+
overlap_history = 17
|
220 |
+
addnoise_condition = 20
|
221 |
elif target_l == "60":
|
222 |
n_frames = 1457
|
223 |
+
overlap_history = 17
|
224 |
+
addnoise_condition = 20
|
225 |
|
226 |
+
return n_frames, overlap_history, addnoise_condition
|
227 |
|
228 |
|
229 |
target_length.change(
|
230 |
fn = set_num_frames,
|
231 |
inputs = [target_length],
|
232 |
+
outputs = [num_frames, overlap_history, addnoise_condition],
|
233 |
queue = False
|
234 |
)
|
235 |
|