Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
afd898a
1
Parent(s):
7a0913a
Killed css
Browse files
app.py
CHANGED
@@ -43,8 +43,7 @@ try:
|
|
43 |
|
44 |
# Load the main transformer from the repo and filename
|
45 |
i2v_transformer = WanTransformer3DModel.from_single_file(
|
46 |
-
|
47 |
-
filename=I2V_FUSIONX_FILENAME,
|
48 |
torch_dtype=torch.bfloat16
|
49 |
)
|
50 |
|
@@ -82,202 +81,8 @@ MAX_FRAMES_MODEL = 81
|
|
82 |
|
83 |
# --- Default Prompts ---
|
84 |
default_prompt_i2v = "Cinematic motion, smooth animation, detailed textures, dynamic lighting, professional cinematography"
|
85 |
-
default_prompt_t2v = "A breathtaking landscape with a flowing river, cinematic, 8k, photorealistic"
|
86 |
default_negative_prompt = "Static image, no motion, blurred details, overexposed, underexposed, low quality, worst quality, JPEG artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, watermark, text, signature, three legs, many people in the background, walking backwards"
|
87 |
|
88 |
-
# --- Enhanced CSS for FusionX theme ---
|
89 |
-
custom_css = """
|
90 |
-
/* Enhanced FusionX theme with cinematic styling */
|
91 |
-
.gradio-container {
|
92 |
-
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
|
93 |
-
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533a7d 75%, #6a4c93 100%) !important;
|
94 |
-
background-size: 400% 400% !important;
|
95 |
-
animation: cinematicShift 20s ease infinite !important;
|
96 |
-
}
|
97 |
-
@keyframes cinematicShift {
|
98 |
-
0% { background-position: 0% 50%; }
|
99 |
-
25% { background-position: 100% 50%; }
|
100 |
-
50% { background-position: 100% 100%; }
|
101 |
-
75% { background-position: 0% 100%; }
|
102 |
-
100% { background-position: 0% 50%; }
|
103 |
-
}
|
104 |
-
/* Main container with cinematic glass effect */
|
105 |
-
.main-container {
|
106 |
-
backdrop-filter: blur(15px);
|
107 |
-
background: rgba(255, 255, 255, 0.08) !important;
|
108 |
-
border-radius: 25px !important;
|
109 |
-
padding: 35px !important;
|
110 |
-
box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.4) !important;
|
111 |
-
border: 1px solid rgba(255, 255, 255, 0.15) !important;
|
112 |
-
position: relative;
|
113 |
-
overflow: hidden;
|
114 |
-
}
|
115 |
-
.main-container::before {
|
116 |
-
content: '';
|
117 |
-
position: absolute;
|
118 |
-
top: 0;
|
119 |
-
left: 0;
|
120 |
-
right: 0;
|
121 |
-
bottom: 0;
|
122 |
-
background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
|
123 |
-
pointer-events: none;
|
124 |
-
}
|
125 |
-
/* Enhanced header with FusionX branding */
|
126 |
-
h1 {
|
127 |
-
background: linear-gradient(45deg, #ffffff, #f0f8ff, #e6e6fa) !important;
|
128 |
-
-webkit-background-clip: text !important;
|
129 |
-
-webkit-text-fill-color: transparent !important;
|
130 |
-
background-clip: text !important;
|
131 |
-
font-weight: 900 !important;
|
132 |
-
font-size: 2.8rem !important;
|
133 |
-
text-align: center !important;
|
134 |
-
margin-bottom: 2.5rem !important;
|
135 |
-
text-shadow: 2px 2px 8px rgba(0,0,0,0.3) !important;
|
136 |
-
position: relative;
|
137 |
-
}
|
138 |
-
h1::after {
|
139 |
-
content: '🎬 FusionX Enhanced';
|
140 |
-
display: block;
|
141 |
-
font-size: 1rem;
|
142 |
-
color: #6a4c93;
|
143 |
-
margin-top: 0.5rem;
|
144 |
-
font-weight: 500;
|
145 |
-
}
|
146 |
-
/* Enhanced component containers */
|
147 |
-
.input-container, .output-container {
|
148 |
-
background: rgba(255, 255, 255, 0.06) !important;
|
149 |
-
border-radius: 20px !important;
|
150 |
-
padding: 25px !important;
|
151 |
-
margin: 15px 0 !important;
|
152 |
-
backdrop-filter: blur(10px) !important;
|
153 |
-
border: 1px solid rgba(255, 255, 255, 0.12) !important;
|
154 |
-
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
|
155 |
-
}
|
156 |
-
/* Cinematic input styling */
|
157 |
-
input, textarea, .gr-box {
|
158 |
-
background: rgba(255, 255, 255, 0.95) !important;
|
159 |
-
border: 1px solid rgba(106, 76, 147, 0.3) !important;
|
160 |
-
border-radius: 12px !important;
|
161 |
-
color: #1a1a2e !important;
|
162 |
-
transition: all 0.4s ease !important;
|
163 |
-
box-shadow: 0 2px 8px rgba(106, 76, 147, 0.1) !important;
|
164 |
-
}
|
165 |
-
input:focus, textarea:focus {
|
166 |
-
background: rgba(255, 255, 255, 1) !important;
|
167 |
-
border-color: #6a4c93 !important;
|
168 |
-
box-shadow: 0 0 0 3px rgba(106, 76, 147, 0.15) !important;
|
169 |
-
transform: translateY(-1px) !important;
|
170 |
-
}
|
171 |
-
/* Enhanced FusionX button */
|
172 |
-
.generate-btn {
|
173 |
-
background: linear-gradient(135deg, #6a4c93 0%, #533a7d 50%, #0f3460 100%) !important;
|
174 |
-
color: white !important;
|
175 |
-
font-weight: 700 !important;
|
176 |
-
font-size: 1.2rem !important;
|
177 |
-
padding: 15px 40px !important;
|
178 |
-
border-radius: 60px !important;
|
179 |
-
border: none !important;
|
180 |
-
cursor: pointer !important;
|
181 |
-
transition: all 0.4s ease !important;
|
182 |
-
box-shadow: 0 6px 20px rgba(106, 76, 147, 0.4) !important;
|
183 |
-
position: relative;
|
184 |
-
overflow: hidden;
|
185 |
-
}
|
186 |
-
.generate-btn::before {
|
187 |
-
content: '';
|
188 |
-
position: absolute;
|
189 |
-
top: 0;
|
190 |
-
left: -100%;
|
191 |
-
width: 100%;
|
192 |
-
height: 100%;
|
193 |
-
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
|
194 |
-
transition: left 0.5s ease;
|
195 |
-
}
|
196 |
-
.generate-btn:hover::before {
|
197 |
-
left: 100%;
|
198 |
-
}
|
199 |
-
.generate-btn:hover {
|
200 |
-
transform: translateY(-3px) scale(1.02) !important;
|
201 |
-
box-shadow: 0 8px 25px rgba(106, 76, 147, 0.6) !important;
|
202 |
-
}
|
203 |
-
/* Enhanced slider styling */
|
204 |
-
input[type="range"] {
|
205 |
-
background: transparent !important;
|
206 |
-
}
|
207 |
-
input[type="range"]::-webkit-slider-track {
|
208 |
-
background: linear-gradient(90deg, rgba(106, 76, 147, 0.3), rgba(83, 58, 125, 0.5)) !important;
|
209 |
-
border-radius: 8px !important;
|
210 |
-
height: 8px !important;
|
211 |
-
}
|
212 |
-
input[type="range"]::-webkit-slider-thumb {
|
213 |
-
background: linear-gradient(135deg, #6a4c93, #533a7d) !important;
|
214 |
-
border: 3px solid white !important;
|
215 |
-
border-radius: 50% !important;
|
216 |
-
cursor: pointer !important;
|
217 |
-
width: 22px !important;
|
218 |
-
height: 22px !important;
|
219 |
-
-webkit-appearance: none !important;
|
220 |
-
box-shadow: 0 2px 8px rgba(106, 76, 147, 0.3) !important;
|
221 |
-
}
|
222 |
-
/* Enhanced accordion */
|
223 |
-
.gr-accordion {
|
224 |
-
background: rgba(255, 255, 255, 0.04) !important;
|
225 |
-
border-radius: 15px !important;
|
226 |
-
border: 1px solid rgba(255, 255, 255, 0.08) !important;
|
227 |
-
margin: 20px 0 !important;
|
228 |
-
backdrop-filter: blur(5px) !important;
|
229 |
-
}
|
230 |
-
/* Enhanced labels */
|
231 |
-
label {
|
232 |
-
color: #ffffff !important;
|
233 |
-
font-weight: 600 !important;
|
234 |
-
font-size: 1rem !important;
|
235 |
-
margin-bottom: 8px !important;
|
236 |
-
text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important;
|
237 |
-
}
|
238 |
-
/* Enhanced image upload */
|
239 |
-
.image-upload {
|
240 |
-
border: 3px dashed rgba(106, 76, 147, 0.4) !important;
|
241 |
-
border-radius: 20px !important;
|
242 |
-
background: rgba(255, 255, 255, 0.03) !important;
|
243 |
-
transition: all 0.4s ease !important;
|
244 |
-
position: relative;
|
245 |
-
}
|
246 |
-
.image-upload:hover {
|
247 |
-
border-color: rgba(106, 76, 147, 0.7) !important;
|
248 |
-
background: rgba(255, 255, 255, 0.08) !important;
|
249 |
-
transform: scale(1.01) !important;
|
250 |
-
}
|
251 |
-
/* Enhanced video output */
|
252 |
-
video {
|
253 |
-
border-radius: 20px !important;
|
254 |
-
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
|
255 |
-
border: 2px solid rgba(106, 76, 147, 0.3) !important;
|
256 |
-
}
|
257 |
-
/* Tab styling */
|
258 |
-
.gr-tabs {
|
259 |
-
border-radius: 15px !important;
|
260 |
-
overflow: hidden;
|
261 |
-
border: 1px solid rgba(255, 255, 255, 0.1) !important;
|
262 |
-
}
|
263 |
-
.gr-tabs .tabs {
|
264 |
-
background-color: rgba(255, 255, 255, 0.05) !important;
|
265 |
-
border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
|
266 |
-
}
|
267 |
-
.gr-tabs .tab-item {
|
268 |
-
background: transparent !important;
|
269 |
-
color: #a9a9d8 !important;
|
270 |
-
border-radius: 10px 10px 0 0 !important;
|
271 |
-
transition: all 0.3s ease !important;
|
272 |
-
padding: 12px 20px !important;
|
273 |
-
}
|
274 |
-
.gr-tabs .tab-item.selected {
|
275 |
-
background: rgba(255, 255, 255, 0.1) !important;
|
276 |
-
color: #ffffff !important;
|
277 |
-
border-bottom: 2px solid #6a4c93 !important;
|
278 |
-
}
|
279 |
-
"""
|
280 |
-
|
281 |
# --- Helper Functions ---
|
282 |
def sanitize_prompt_for_filename(prompt: str, max_len: int = 60) -> str:
|
283 |
"""Sanitizes a prompt string to be used as a valid filename."""
|
@@ -371,7 +176,7 @@ def generate_i2v_video(input_image, prompt, height, width,
|
|
371 |
return video_path, current_seed, gr.File(value=video_path, visible=True, label=f"📥 Download: {filename}")
|
372 |
|
373 |
# --- Gradio UI Layout ---
|
374 |
-
with gr.Blocks(
|
375 |
with gr.Column(elem_classes=["main-container"]):
|
376 |
gr.Markdown("# ⚡ FusionX Enhanced Wan 2.1 Video Suite")
|
377 |
|
|
|
43 |
|
44 |
# Load the main transformer from the repo and filename
|
45 |
i2v_transformer = WanTransformer3DModel.from_single_file(
|
46 |
+
"https://huggingface.co/vrgamedevgirl84/Wan14BT2VFusioniX/blob/main/Wan14Bi2vFusioniX_fp16.safetensors",
|
|
|
47 |
torch_dtype=torch.bfloat16
|
48 |
)
|
49 |
|
|
|
81 |
|
82 |
# --- Default Prompts ---
|
83 |
default_prompt_i2v = "Cinematic motion, smooth animation, detailed textures, dynamic lighting, professional cinematography"
|
|
|
84 |
default_negative_prompt = "Static image, no motion, blurred details, overexposed, underexposed, low quality, worst quality, JPEG artifacts, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, watermark, text, signature, three legs, many people in the background, walking backwards"
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
# --- Helper Functions ---
|
87 |
def sanitize_prompt_for_filename(prompt: str, max_len: int = 60) -> str:
|
88 |
"""Sanitizes a prompt string to be used as a valid filename."""
|
|
|
176 |
return video_path, current_seed, gr.File(value=video_path, visible=True, label=f"📥 Download: {filename}")
|
177 |
|
178 |
# --- Gradio UI Layout ---
|
179 |
+
with gr.Blocks() as demo:
|
180 |
with gr.Column(elem_classes=["main-container"]):
|
181 |
gr.Markdown("# ⚡ FusionX Enhanced Wan 2.1 Video Suite")
|
182 |
|