Skip to content
Python

lab: 24 tplx-* experiments for the weak templates; --only takes patterns

neuregex770864321bd4
diff --git a/lab/cases.json b/lab/cases.json
index b50d074..c35ab72 100644
--- a/lab/cases.json
+++ b/lab/cases.json
@@ -463,6 +463,79 @@
{"id": "tpl-zooms", "showcase": true, "app": "zooms", "values": {"image": "@case:ref-fx-street"},
"note": "Zooms. A close-up of the woman in the raincoat."},
{"id": "tpl-whats-next", "showcase": true, "app": "whats-next", "values": {"image": "@case:ref-fx-road"},
- "note": "What's Next?. The next shot of the road: wider, more landscape."}
+ "note": "What's Next?. The next shot of the road: wider, more landscape."},
+
+ {"id": "tplx-truck-ad-a", "app": "truck-ad", "values": {"image": "@case:ref-product", "aspect": "16:9 (Widescreen)", "enhance": false},
+ "overrides": [{"node": "398:376", "field": "value", "value": "A square glass perfume bottle with a gold cap stands on a white kitchen counter in the center of the frame and never leaves it; the camera is locked, no movement. Through the window behind the counter a white delivery truck drives slowly past, and this same bottle is printed huge on the truck's side panel, sunlight flashing on the panel. Traffic sounds."}],
+ "note": "Truck Ad experiment A (enhance off, locked camera, truck in the background): in run 20261022-0358 the camera left the bottle for a truck."},
+ {"id": "tplx-truck-ad-b", "app": "truck-ad", "values": {"image": "@case:ref-product", "aspect": "16:9 (Widescreen)", "enhance": false},
+ "overrides": [{"node": "398:376", "field": "value", "value": "The bottle stays in the center of the frame, in sharp focus, camera locked. A toy-sized white delivery truck drives into the frame along the counter, this exact bottle printed on its side panel, and parks beside the bottle. Soft toy engine sound."}],
+ "note": "Truck Ad experiment B (enhance off, a toy truck comes to the bottle)."},
+ {"id": "tplx-kick-ad-a", "app": "kick-ad", "values": {"image": "@case:ref-product", "aspect": "16:9 (Widescreen)", "enhance": false},
+ "overrides": [{"node": "398:376", "field": "value", "value": "The bottle stands in the exact center of the frame on the counter and does not move at all for the whole shot; the camera is locked. Plain grey cardboard boxes slide in from the left and from the right, bump against the bottle and bounce away, tumbling out of the frame, while the bottle stays still and upright until the last frame. Cartoon whoosh and thud sounds."}],
+ "note": "Kick Ad experiment A (enhance off, the bottle never moves): in run 20261022-0358 the box knocked the bottle out of frame."},
+ {"id": "tplx-kick-ad-b", "app": "kick-ad", "values": {"image": "@case:ref-product", "aspect": "16:9 (Widescreen)", "enhance": false},
+ "overrides": [{"node": "398:376", "field": "value", "value": "The bottle stays centered and upright on the counter; the camera is locked. Each plain grey box that slides toward it is flicked away by a short hop of the bottle, which lands back on the same spot; the boxes tumble off screen. The bottle is in the center of the frame until the last frame. Comedic whoosh and thud sounds."}],
+ "note": "Kick Ad experiment B (enhance off, the bottle hops to kick)."},
+ {"id": "tplx-volcano-ad-a", "app": "volcano-ad", "values": {"image": "@case:ref-product", "aspect": "16:9 (Widescreen)", "enhance": false},
+ "overrides": [{"node": "398:376", "field": "value", "value": "Locked-off shot, no camera movement. The bottle stays in the center of the frame, in sharp focus, for the entire clip. Behind it the white wall dissolves into an erupting volcano far in the distance: lava fountains, glowing ash drifting, heat shimmer, all out of focus; a red glow reflects on the glass. Deep rumble."}],
+ "note": "Volcano Ad experiment A (enhance off, locked camera): in run 20261022-0358 the camera panned away to the volcano."},
+ {"id": "tplx-volcano-ad-b", "app": "volcano-ad", "values": {"image": "@case:ref-product", "aspect": "16:9 (Widescreen)", "enhance": false},
+ "overrides": [{"node": "398:376", "field": "value", "value": "The bottle stands on black volcanic rock in the center of the frame and stays there; a slow push-in toward the bottle only, never panning away. Far behind it a volcano erupts, lava and ash in the background, red glow on the glass. Deep rumbling."}],
+ "note": "Volcano Ad experiment B (enhance off, push-in only)."},
+ {"id": "tplx-storm-creature-a", "app": "storm-creature", "values": {"image": "@case:ref-fx-storm", "aspect": "16:9 (Widescreen)", "enhance": false},
+ "overrides": [{"node": "398:376", "field": "value", "value": "Locked wide shot of the oak tree on the hill; the tree stays in the frame. Behind it a giant humanoid creature made of dark storm cloud rises from the clouds on the horizon, with a head, shoulders and two arms, lightning flickering inside its body, towering over the tree; rain begins to fall. Thunder and wind."}],
+ "note": "Storm Creature experiment A (enhance off, a humanoid named part by part): in run 20261022-0358 a cloud replaced the tree and no creature appeared."},
+ {"id": "tplx-storm-creature-b", "app": "storm-creature", "values": {"image": "@case:ref-fx-storm", "aspect": "16:9 (Widescreen)", "enhance": false},
+ "overrides": [{"node": "398:376", "field": "value", "value": "The storm clouds over the hill gather into the shape of a colossal cloud giant standing behind the hill: a face, broad shoulders, two arms spreading wide, lightning flashing inside its chest, the oak tree small in front of it; rain starts. Thunder and wind."}],
+ "note": "Storm Creature experiment B (enhance off, the clouds gather into a giant)."},
+ {"id": "tplx-roller-coaster-m", "app": "morph", "values": {"image": "@case:ref-fx-woman-a", "effect": "astronaut", "details": "", "aspect": "portrait", "duration": 4},
+ "overrides": [{"node": "edit:4", "field": "text", "value": "Put this exact person in the front seat of a roller coaster car at the top of the first drop: a padded safety bar across the chest, hands in the air, hair blown back, a wide excited grin, the camera mounted on the car facing them, blue sky and the steel track behind. Keep the face identical."}, {"node": "251:252", "field": "value", "value": "The scene turns into a roller coaster ride: the car crests the top and drops, the person screams with joy, hands up, hair whipping, the track rushing behind; clattering track and wind."}],
+ "note": "Roller Coaster on the morph recipe (Klein last frame + transition): in run 20261022-0358 the LTX template kept the studio and only laughed."},
+ {"id": "tplx-cloud-surf-m", "app": "morph", "values": {"image": "@case:ref-fx-man-b", "effect": "astronaut", "details": "", "aspect": "portrait", "duration": 4},
+ "overrides": [{"node": "edit:4", "field": "text", "value": "Put this exact person standing on a surfboard riding across fluffy pink clouds at sunset, knees bent, arms out for balance, cloud mist spraying around the board, seen from a low dynamic angle, the face large and clear. Keep the face identical."}, {"node": "251:252", "field": "value", "value": "The scene turns into a ride across pink clouds at sunset: the person carves over the cloud tops on the surfboard, mist spraying, a dynamic tracking shot staying close to them; wind and a cheerful whoosh."}],
+ "note": "Cloud Surf on the morph recipe: in run 20261022-0358 the LTX template made the person tiny and far away."},
+ {"id": "tplx-ugc-shot-a", "app": "ugc-shot", "values": {"image": "@case:ref-product"},
+ "overrides": [{"node": "4", "field": "text", "value": "Add a hand holding this bottle from below and replace the background with a bright kitchen, as a casual phone snapshot with slightly tilted framing and natural light. The bottle itself does not change: same angle, same size, and the label text stays sharp and perfectly legible, exactly as written in the photo."}],
+ "note": "UGC experiment A (add a hand, keep the bottle as is): in run 20261022-0351 the label's letters came out garbled."},
+ {"id": "tplx-ugc-shot-b", "app": "ugc-shot", "values": {"image": "@case:ref-product"},
+ "overrides": [{"node": "4", "field": "text", "value": "A casual phone photo of a hand holding the product from the photo in a bright kitchen, natural light, slightly tilted framing, like a social media post. Keep the product identical: shape, colors, and the label with its text rendered exactly as written in the photo, crisp and readable; do not invent letters."}],
+ "note": "UGC experiment B (the original template plus an explicit text instruction)."},
+ {"id": "tplx-commercial-faces-a", "app": "commercial-faces", "values": {"image": "@case:ref-fx-man-b"},
+ "overrides": [{"node": "4", "field": "text", "value": "Turn this photo into a skincare advertisement: the same person with glowing dewy skin, bare shoulders, in a bright white studio with soft beauty-dish lighting, holding a small white jar of face cream near the cheek, clean pastel backdrop, glossy magazine composition with empty space on the left for a headline. Keep the face identical."}],
+ "note": "Commercial Faces experiment A (skincare, scene spelled out): in run 20261022-0351 only the background changed."},
+ {"id": "tplx-commercial-faces-b", "app": "commercial-faces", "values": {"image": "@case:ref-fx-man-b"},
+ "overrides": [{"node": "4", "field": "text", "value": "Turn this photo into a sportswear campaign shot: the same person in a black athletic top, a light sheen of sweat, dramatic low-key lighting with a rim light, dark concrete gym background, intense look at the camera, editorial composition. Keep the face identical."}],
+ "note": "Commercial Faces experiment B (sportswear, scene spelled out)."},
+ {"id": "tplx-render-3d-a", "app": "render-3d", "values": {"image": "@case:ref-fx-woman-a"},
+ "overrides": [{"node": "4", "field": "text", "value": "Turn this photo into a stylized 3D character render like a still from a modern animated film: the same person as a 3D cartoon character with smooth skin, large expressive eyes, exaggerated proportions, matte clay-like materials, soft studio lighting with subsurface scattering, clean gradient background; same hairstyle and clothes."}],
+ "note": "3D Render experiment A (animated-film character): in run 20261022-0351 the photo came back unchanged."},
+ {"id": "tplx-render-3d-b", "app": "render-3d", "values": {"image": "@case:ref-fx-woman-a"},
+ "overrides": [{"node": "4", "field": "text", "value": "Remake this photo as a 3D clay render: the person and everything in the frame become a smooth matte clay sculpture with simplified shapes and soft sculpted edges, three-point studio lighting, plain gradient backdrop."}],
+ "note": "3D Render experiment B (clay sculpture)."},
+ {"id": "tplx-victory-card-a", "app": "victory-card", "values": {"image": "@case:ref-fx-woman-a"},
+ "overrides": [{"node": "4", "field": "text", "value": "Make one large ornate playing card, the queen of hearts, lying on green casino felt next to a stack of poker chips. The card's portrait is this person's face, large and clearly recognizable, drawn in the classic playing-card illustration style with gold foil borders and the Q and heart symbols in the corners."}],
+ "note": "Victory Card experiment A (one big card with the portrait): in run 20261022-0351 the cards had no person on them."},
+ {"id": "tplx-victory-card-b", "app": "victory-card", "values": {"image": "@case:ref-fx-woman-a"},
+ "overrides": [{"node": "4", "field": "text", "value": "A winning royal flush fanned on green casino felt; the top card, fully visible, is the queen of hearts whose portrait is this person's face, large and recognizable, in classic playing-card illustration style with gold foil borders; poker chips beside the cards."}],
+ "note": "Victory Card experiment B (a fanned hand, the portrait on the top card)."},
+ {"id": "tplx-image-effects-a", "app": "image-effects", "values": {"image": "@case:ref-fx-cafe", "effect": "glitch distortion with RGB split"},
+ "overrides": [{"node": "4", "field": "text", "value": "Apply a heavy digital glitch effect to this photo: strong horizontal displacement bands, red and cyan RGB channel split, blocky pixel corruption, scan lines and data-mosh smears across the frame; the scene stays recognizable."}],
+ "note": "Image Effects experiment A (glitch, every artifact named): in run 20261022-0351 the glitch was barely visible."},
+ {"id": "tplx-image-effects-b", "app": "image-effects", "values": {"image": "@case:ref-fx-cafe", "effect": "double exposure"},
+ "overrides": [{"node": "4", "field": "text", "value": "Turn this photo into a double exposure: the silhouette of the man is filled with a pine forest and mountains at dusk, the cafe background fades to white, soft blend, fine-art look."}],
+ "note": "Image Effects experiment B (double exposure, spelled out)."},
+ {"id": "tplx-color-grade-a", "app": "color-grade", "values": {"image": "@case:ref-fx-cafe", "look": "teal and orange blockbuster"},
+ "overrides": [{"node": "4", "field": "text", "value": "Apply a strong teal and orange cinematic color grade to this photo: shadows pushed to deep teal, skin tones and highlights warm orange, high contrast, slightly lifted blacks, fine film grain, like a blockbuster movie still; keep every detail and the composition."}],
+ "note": "Color Grade experiment A (teal and orange, tones named): in run 20261022-0351 the grade was barely visible."},
+ {"id": "tplx-color-grade-b", "app": "color-grade", "values": {"image": "@case:ref-fx-cafe", "look": "cold noir"},
+ "overrides": [{"node": "4", "field": "text", "value": "Apply a cold noir color grade to this photo: heavily desaturated, blue-black shadows, pale cool skin, crushed blacks, hard contrast, a faint cyan tint in the highlights; keep every detail and the composition."}],
+ "note": "Color Grade experiment B (cold noir, tones named)."},
+ {"id": "tplx-face-swap-a", "app": "face-swap", "values": {"image": "@case:ref-face-a", "image2": "@case:ref-fx-woman-b"},
+ "overrides": [{"node": "4", "field": "text", "value": "Replace only the face of the woman in the first image with the face of the woman in the second image. Keep the first image's hair, denim jacket, head angle, expression, lighting, grey background and framing exactly; the output is the first image with the new face."}],
+ "note": "Face Swap experiment A (first/second named in words): in run 20261022-0351 the output was the second photo, not the first with a new face."},
+ {"id": "tplx-face-swap-b", "app": "face-swap", "values": {"image": "@case:ref-fx-woman-b", "image2": "@case:ref-face-a"},
+ "overrides": [{"node": "4", "field": "text", "value": "Replace only the face of the woman in the first image with the face of the woman in the second image. Keep the first image's hair, clothes, head angle, expression, lighting, background and framing exactly; the output is the first image with the new face."}],
+ "note": "Face Swap experiment B (same words, the two photos swapped): tells which image Klein treats as the base."}
]
}
diff --git a/lab/lab_modal.py b/lab/lab_modal.py
index 7417c37..afaf3f6 100644
--- a/lab/lab_modal.py
+++ b/lab/lab_modal.py
@@ -23,6 +23,7 @@ the wait is about 1/N.
from __future__ import annotations
import json
+from fnmatch import fnmatch
import os
import re
import sys
@@ -205,18 +206,20 @@ def finish(run_id: str, publish: bool) -> None:
@app.local_entrypoint()
def main(cases: str = "lab/cases.json", only: str = "", apps: str = "", showcase: bool = False,
run_id: str = "", publish: bool = True, pull: str = "", shards: int = 1):
- """--showcase (one case per app), --only case,ids or --apps app,ids; their reference cases come along.
+ """--showcase (one case per app), --only case,ids (a pattern like tplx-* works) or --apps app,ids; their reference cases come along.
--shards N splits them over N GPU containers that run at the same time.
--pull <run_id> only copies an earlier run back (say, after the terminal closed) and publishes it."""
if pull:
finish(pull, publish)
return
spec = json.loads(Path(cases).read_text(encoding="utf-8"))["cases"]
- keep = set(filter(None, only.split(","))) | {c["id"] for c in spec if c["app"] in set(filter(None, apps.split(",")))}
+ ids = {c["id"] for c in spec}
+ wanted = list(filter(None, only.split(","))) # ids, or patterns like tplx-* (fnmatch)
+ keep = {i for w in wanted for i in ids if fnmatch(i, w)} | {c["id"] for c in spec if c["app"] in set(filter(None, apps.split(",")))}
if showcase:
keep |= {c["id"] for c in spec if c.get("showcase")}
if only or apps or showcase:
- unknown = set(filter(None, only.split(","))) - {c["id"] for c in spec}
+ unknown = [w for w in wanted if not any(fnmatch(i, w) for i in ids)]
if unknown:
raise SystemExit(f"unknown case id(s): {', '.join(sorted(unknown))}")
spec = with_dependencies(spec, keep)