Spaces:
Running
Running
Upload app.py
Browse filesChanged layout
app.py
CHANGED
|
@@ -20,8 +20,8 @@ class T2VReq(BaseModel):
|
|
| 20 |
cfg: Optional[float] = 1
|
| 21 |
width: Optional[int] = 640
|
| 22 |
height: Optional[int] = 640
|
| 23 |
-
length: Optional[int] =
|
| 24 |
-
fps: Optional[int] =
|
| 25 |
filename_prefix: Optional[str] = "video/ComfyUI"
|
| 26 |
|
| 27 |
def _inject_params(prompt: Dict[str, Any], r: T2VReq) -> Dict[str, Any]:
|
|
@@ -77,12 +77,12 @@ def _extract_video_from_history(history: Dict[str, Any]) -> Dict[str, str]:
|
|
| 77 |
return {"filename": it["filename"], "subfolder": it["subfolder"], "type": it["type"]}
|
| 78 |
raise RuntimeError("No video file found in history outputs")
|
| 79 |
|
| 80 |
-
sample_prompts = [
|
| 81 |
-
"A golden retriever running across a beach at sunset, cinematic",
|
| 82 |
-
"A cyberpunk city street at night with neon lights, light rain, slow pan",
|
| 83 |
-
"An astronaut walking on an alien planet covered in glowing crystals, purple sky with two moons, dust particles floating, slow panning shot, highly detailed, cinematic atmosphere.",
|
| 84 |
-
"A cat gracefully jumping between rooftops in slow motion, warm sunset lighting, camera tracking the cat midair, cinematic composition, natural movement."
|
| 85 |
-
]
|
| 86 |
|
| 87 |
with gr.Blocks(
|
| 88 |
title="T2V UI",
|
|
@@ -95,21 +95,23 @@ with gr.Blocks(
|
|
| 95 |
gr.Markdown("### Prompt")
|
| 96 |
text = gr.Textbox(label="Prompt", placeholder="Describe the video you want", lines=3)
|
| 97 |
|
| 98 |
-
gr.Examples(examples=sample_prompts, inputs=text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
|
| 100 |
with gr.Accordion("Advanced Settings", open=False):
|
| 101 |
-
with gr.Row():
|
| 102 |
-
width = gr.Number(label="Width", value=640, precision=0)
|
| 103 |
-
height = gr.Number(label="Height", value=640, precision=0)
|
| 104 |
-
with gr.Row():
|
| 105 |
-
length = gr.Number(label="Frames", value=81, precision=0)
|
| 106 |
-
fps = gr.Number(label="FPS", value=8, precision=0)
|
| 107 |
with gr.Row():
|
| 108 |
steps = gr.Number(label="Steps", value=4, precision=0)
|
| 109 |
cfg = gr.Number(label="CFG", value=5.0)
|
| 110 |
seed = gr.Number(label="Seed (optional)", value=None)
|
| 111 |
-
|
| 112 |
-
|
|
|
|
| 113 |
|
| 114 |
with gr.Row():
|
| 115 |
with gr.Column(scale=1):
|
|
|
|
| 20 |
cfg: Optional[float] = 1
|
| 21 |
width: Optional[int] = 640
|
| 22 |
height: Optional[int] = 640
|
| 23 |
+
length: Optional[int] = 160
|
| 24 |
+
fps: Optional[int] = 10
|
| 25 |
filename_prefix: Optional[str] = "video/ComfyUI"
|
| 26 |
|
| 27 |
def _inject_params(prompt: Dict[str, Any], r: T2VReq) -> Dict[str, Any]:
|
|
|
|
| 77 |
return {"filename": it["filename"], "subfolder": it["subfolder"], "type": it["type"]}
|
| 78 |
raise RuntimeError("No video file found in history outputs")
|
| 79 |
|
| 80 |
+
# sample_prompts = [
|
| 81 |
+
# "A golden retriever running across a beach at sunset, cinematic",
|
| 82 |
+
# "A cyberpunk city street at night with neon lights, light rain, slow pan",
|
| 83 |
+
# "An astronaut walking on an alien planet covered in glowing crystals, purple sky with two moons, dust particles floating, slow panning shot, highly detailed, cinematic atmosphere.",
|
| 84 |
+
# "A cat gracefully jumping between rooftops in slow motion, warm sunset lighting, camera tracking the cat midair, cinematic composition, natural movement."
|
| 85 |
+
#]
|
| 86 |
|
| 87 |
with gr.Blocks(
|
| 88 |
title="T2V UI",
|
|
|
|
| 95 |
gr.Markdown("### Prompt")
|
| 96 |
text = gr.Textbox(label="Prompt", placeholder="Describe the video you want", lines=3)
|
| 97 |
|
| 98 |
+
# gr.Examples(examples=sample_prompts, inputs=text)
|
| 99 |
+
|
| 100 |
+
with gr.Row():
|
| 101 |
+
width = gr.Number(label="Width", value=640, precision=0, step=8)
|
| 102 |
+
height = gr.Number(label="Height", value=640, precision=0, step=8)
|
| 103 |
+
# with gr.Row():
|
| 104 |
+
length = gr.Number(label="Frames", value=160, precision=0)
|
| 105 |
+
fps = gr.Number(label="FPS", value=10, precision=0)
|
| 106 |
|
| 107 |
with gr.Accordion("Advanced Settings", open=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
with gr.Row():
|
| 109 |
steps = gr.Number(label="Steps", value=4, precision=0)
|
| 110 |
cfg = gr.Number(label="CFG", value=5.0)
|
| 111 |
seed = gr.Number(label="Seed (optional)", value=None)
|
| 112 |
+
with gr.Row():
|
| 113 |
+
filename_prefix = gr.Textbox(label="Filename prefix", value="video/ComfyUI")
|
| 114 |
+
st_token = gr.Textbox(label="token", placeholder="name")
|
| 115 |
|
| 116 |
with gr.Row():
|
| 117 |
with gr.Column(scale=1):
|