Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,35 +93,36 @@ def _prompt_with_tags(user_prompt: str, n_shots: int, default_fps: int, default_
|
|
| 93 |
f"'''{user_prompt}'''\n\n"
|
| 94 |
"Each item schema:\n"
|
| 95 |
"{\n"
|
| 96 |
-
'
|
| 97 |
-
'
|
| 98 |
-
'
|
| 99 |
-
f
|
| 100 |
-
f
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
'
|
| 104 |
"}\n\n"
|
| 105 |
"Output must start with <JSON> and end with </JSON>.\n"
|
| 106 |
)
|
| 107 |
|
|
|
|
| 108 |
def _prompt_minimal(user_prompt: str, n_shots: int, default_fps: int, default_len: int) -> str:
|
| 109 |
return (
|
| 110 |
"Reply ONLY with a JSON array starting with '[' and ending with ']'. No extra text.\n"
|
| 111 |
f"Storyboard: {n_shots} shots for:\n'''{user_prompt}'''\n"
|
| 112 |
"Item schema:\n"
|
| 113 |
"{\n"
|
| 114 |
-
'
|
| 115 |
-
'
|
| 116 |
-
'
|
| 117 |
-
f
|
| 118 |
-
f
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
'
|
| 122 |
"}\n"
|
| 123 |
)
|
| 124 |
-
|
| 125 |
def _apply_chat(tok, system_msg: str, user_msg: str) -> str:
|
| 126 |
if hasattr(tok, "apply_chat_template"):
|
| 127 |
return tok.apply_chat_template(
|
|
|
|
| 93 |
f"'''{user_prompt}'''\n\n"
|
| 94 |
"Each item schema:\n"
|
| 95 |
"{\n"
|
| 96 |
+
' "id": <int starting at 1>,\n'
|
| 97 |
+
' "title": "Short shot title",\n'
|
| 98 |
+
' "description": "Highly specific visual description for image generation. Include camera angle, framing, time of day, subject position, lighting, mood, and background details.",\n'
|
| 99 |
+
f' "duration": {default_len},\n'
|
| 100 |
+
f' "fps": {default_fps},\n'
|
| 101 |
+
' "steps": 30,\n'
|
| 102 |
+
' "seed": null,\n'
|
| 103 |
+
' "negative": ""\n'
|
| 104 |
"}\n\n"
|
| 105 |
"Output must start with <JSON> and end with </JSON>.\n"
|
| 106 |
)
|
| 107 |
|
| 108 |
+
|
| 109 |
def _prompt_minimal(user_prompt: str, n_shots: int, default_fps: int, default_len: int) -> str:
|
| 110 |
return (
|
| 111 |
"Reply ONLY with a JSON array starting with '[' and ending with ']'. No extra text.\n"
|
| 112 |
f"Storyboard: {n_shots} shots for:\n'''{user_prompt}'''\n"
|
| 113 |
"Item schema:\n"
|
| 114 |
"{\n"
|
| 115 |
+
' "id": <int starting at 1>,\n'
|
| 116 |
+
' "title": "Short title",\n'
|
| 117 |
+
' "description": "Visual description",\n'
|
| 118 |
+
f' "duration": {default_len},\n'
|
| 119 |
+
f' "fps": {default_fps},\n'
|
| 120 |
+
' "steps": 30,\n'
|
| 121 |
+
' "seed": null,\n'
|
| 122 |
+
' "negative": ""\n'
|
| 123 |
"}\n"
|
| 124 |
)
|
| 125 |
+
|
| 126 |
def _apply_chat(tok, system_msg: str, user_msg: str) -> str:
|
| 127 |
if hasattr(tok, "apply_chat_template"):
|
| 128 |
return tok.apply_chat_template(
|