Spaces:
Running on Zero
fix: mode 11 says an old-sounding recording can come out as a period film, and how to get colour: one sentence under its first-frame picture, above the prompt, in Audio to video only (#28)
Browse filesOn the Space the same prompt and recording gave a 1940s-film picture at seed 7 and
colour at seed 21; with a first-frame picture the result is in colour. A user who
expected colour got a period look and did not know why.
The sentence is "An old-sounding recording can come out as a period film: say “in
colour” in the prompt, or give a first-frame picture." It is in the caption of
Audio to video's optional first-frame image, which sits between the picture input
and the prompt box, the two remedies it names; the audio caption keeps its three
sentences about lip-sync as round 3 pinned them.
Test (tests/test_ui_copy.py, through the built page's own switch): in Audio to
video exactly one shown component holds the sentence, the image caption, between
the image and the prompt; in every other mode none does.
- docs/UI_DESIGN.md +6 -0
- ltx25_studio/ui/render.py +5 -1
- tests/test_ui_copy.py +39 -0
|
@@ -99,6 +99,12 @@ for its audio, then offers an optional first-frame image). DOM order is visual o
|
|
| 99 |
and focus order; no CSS reorders them. A registry no single order could satisfy fails
|
| 100 |
at build time.
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
**Parking.** When the mode changes, the value of every field the new mode does not use
|
| 103 |
is parked: it moves into a session `gr.State`, and the widget goes back to its default.
|
| 104 |
The value comes back when a mode that uses it is selected (`handlers.mode_switch`).
|
|
|
|
| 99 |
and focus order; no CSS reorders them. A registry no single order could satisfy fails
|
| 100 |
at build time.
|
| 101 |
|
| 102 |
+
**Mode 11's help.** Under Audio to video's audio, the line says speech is not
|
| 103 |
+
lip-synced and where a speaking face is made. Under its optional first-frame image,
|
| 104 |
+
above the prompt, the line says an old-sounding recording can come out as a period
|
| 105 |
+
film, and the two ways to get colour: "in colour" in the prompt, or a first-frame
|
| 106 |
+
picture. No other mode says either.
|
| 107 |
+
|
| 108 |
**Parking.** When the mode changes, the value of every field the new mode does not use
|
| 109 |
is parked: it moves into a session `gr.State`, and the widget goes back to its default.
|
| 110 |
The value comes back when a mode that uses it is selected (`handlers.mode_switch`).
|
|
@@ -358,7 +358,11 @@ _CAPTIONS: dict[tuple[str, str], str] = {
|
|
| 358 |
"lip-synced. For a face that speaks in time, use Image + text to video with sound and "
|
| 359 |
"write the words in quotes in your prompt; the model voices them itself."
|
| 360 |
),
|
| 361 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 362 |
}
|
| 363 |
|
| 364 |
|
|
|
|
| 358 |
"lip-synced. For a face that speaks in time, use Image + text to video with sound and "
|
| 359 |
"write the words in quotes in your prompt; the model voices them itself."
|
| 360 |
),
|
| 361 |
+
# Under the first-frame picture, above the prompt: the two remedies it names.
|
| 362 |
+
("audio_to_video", "image"): (
|
| 363 |
+
"Optional. Used as the first frame. An old-sounding recording can come out as a period "
|
| 364 |
+
"film: say “in colour” in the prompt, or give a first-frame picture."
|
| 365 |
+
),
|
| 366 |
}
|
| 367 |
|
| 368 |
|
|
@@ -246,6 +246,45 @@ def test_the_lip_sync_line_is_under_the_audio_in_audio_to_video_and_nowhere_else
|
|
| 246 |
)
|
| 247 |
|
| 248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
def test_mode_11_states_its_limit_in_its_purpose_line_and_the_remedy_under_its_audio():
|
| 250 |
mode = modes.get_mode("audio_to_video")
|
| 251 |
assert render.purpose_line(mode) == PURPOSE_11
|
|
|
|
| 246 |
)
|
| 247 |
|
| 248 |
|
| 249 |
+
#: Mode 11 with a recording and no picture sometimes renders a black-and-white period film (#28).
|
| 250 |
+
PERIOD_FILM = (
|
| 251 |
+
"An old-sounding recording can come out as a period film: say “in colour” in the prompt, "
|
| 252 |
+
"or give a first-frame picture."
|
| 253 |
+
)
|
| 254 |
+
|
| 255 |
+
|
| 256 |
+
def test_the_period_film_sentence_is_in_mode_11s_help_and_nowhere_else(tmp_path, monkeypatch):
|
| 257 |
+
"""Through the built page's own switch: in Audio to video the sentence is shown, under the
|
| 258 |
+
first-frame picture and above the prompt, by exactly one component; in no other mode."""
|
| 259 |
+
pytest.importorskip("gradio", reason="gradio is a declared dev dependency")
|
| 260 |
+
from test_ui_form import Form
|
| 261 |
+
|
| 262 |
+
from ltx25_studio.ui import build_ui, showcase
|
| 263 |
+
|
| 264 |
+
monkeypatch.setenv(showcase.EXAMPLES_ENV, str(tmp_path / "no-examples"))
|
| 265 |
+
demo = build_ui()
|
| 266 |
+
form = Form(demo)
|
| 267 |
+
blocks = sorted(demo.blocks.values(), key=lambda block: block._id)
|
| 268 |
+
|
| 269 |
+
def holders() -> list:
|
| 270 |
+
return [
|
| 271 |
+
b
|
| 272 |
+
for b in blocks
|
| 273 |
+
if form.visible(b) and any(PERIOD_FILM in text for text in _texts(form, b))
|
| 274 |
+
]
|
| 275 |
+
|
| 276 |
+
for mode_id in MODE_IDS:
|
| 277 |
+
form.pick_mode(mode_id)
|
| 278 |
+
if mode_id == "audio_to_video":
|
| 279 |
+
(caption,) = holders()
|
| 280 |
+
assert "mr-caption" in caption.elem_classes
|
| 281 |
+
assert form.fields["image"]._id < caption._id < form.fields["prompt"]._id
|
| 282 |
+
assert form.get(caption) == render.media_caption(modes.get_mode(mode_id), "image")
|
| 283 |
+
else:
|
| 284 |
+
assert holders() == [], mode_id
|
| 285 |
+
assert render.media_caption(modes.get_mode("audio_to_video"), "image").endswith(PERIOD_FILM)
|
| 286 |
+
|
| 287 |
+
|
| 288 |
def test_mode_11_states_its_limit_in_its_purpose_line_and_the_remedy_under_its_audio():
|
| 289 |
mode = modes.get_mode("audio_to_video")
|
| 290 |
assert render.purpose_line(mode) == PURPOSE_11
|