Taste Application Skill
- Installs
- 3.9k
- Repo stars
- 313k
- Security scans passed
- 3/3
- Repo updated
- Nov 23, 2026
TL;DR
Generates new video in a captured visual style, grades it with a measured LUT and cuts it into a finished edit.
npx skills add https://github.com/affaan-m/ECC --skill taste-applicationTry it first through the Skillselion MCP - nothing to install, nothing on disk.
1. Add the remote connector:
claude mcp add --transport http skillselion https://mcp.skillselion.com/mcp2. Ask your agent:
Use Skillselion load_skill to load skill:affaan-m/ecc#taste-application (Taste Application) and follow it.Try it first through the Skillselion MCP - nothing to install, nothing on disk.
1. Add this URL as a custom connector (Claude.ai, ChatGPT or Cursor):
https://mcp.skillselion.com/mcp2. Ask your agent:
Use Skillselion load_skill to load skill:affaan-m/ecc#taste-application (Taste Application) and follow it.What taste-application covers
- Plans shot takes from a reference's cut rhythm
- Grades footage with a LUT measured from a style pack
- Exports editable FCPXML and EDL timelines with a run manifest
taste-application by the numbers
| All-time installs | 3,891 | skills.sh registry |
|---|---|---|
| Repo stars | ★ 313k | GitHub |
| Security audit | 3 / 3 scanners passed | skills.sh audit |
| Repo last updated | November 23, 2026 | GitHub |
| Repository | affaan-m/ECC ↗ | |
Data as of Nov 29, 2026 (Skillselion catalog sync)
What files ship with taste-application?
Taste Application
The second half of the pipeline. taste-distillation measures references into a style pack; this generates against that pack and cuts the result.
Execution and Delivery Contract
The original implementation ships here in scripts/; no separate ito-video checkout is required. Install scripts/requirements.txt for local processing. Install scripts/requirements-live.txt only for provider execution. Live uploads, submissions and downloads require explicit TASTE_FORGE_ALLOW_LIVE=1 in addition to credentials; set it only for the user's authorized run. --dry-run remains credential-free and produces labelled placeholders. An ambiguous provider timeout is not retried as a new paid job. Inspect the provider request before deciding whether another submission is warranted.
Use existing completed takes without any provider calls:
python scripts/pipeline.py --genre example --root stylepacks \
--takes media/take-a.mp4 media/take-b.mp4 --duration 12 --fps 30 \
--out out/review-v1.mp4--duration is a best-effort cadence target, not an exact runtime. Complete shots may produce a shorter or longer edit; the assembler does not duplicate clips or add padding to meet the target. The output manifest retains actual duration and adds duration_contract with requested and actual seconds, shortfall, overrun, and the cadence_target policy. Differences of at least one output frame are warned explicitly. No exact-duration mode is provided; when an exact runtime is required, inspect the receipt and revise or reject the cut before delivery.
The pipeline keeps each run's graded shot files because the editable FCPXML and EDL reference them. It refuses output collisions and reports timeline export failures. A completed render is not a saved editor project or creative approval. Preserve source assets and versioned project checkpoints before and after live edits; record the saved path and digest separately from the in-memory timeline receipt.
Clone-ready Fal graphs and their offline input compiler are documented in workflows/README.md. Compile brief and style direction before submission; do not assume a disconnected schema field affects a model prompt. Validate current endpoint fields against the actual provider before a paid run.
For Blender, use the full textured source GLB; retopology is a separately named derivative and never replaces that source. blender_prop.py supports explicit --width 1920 --height 1080 --fps 30 --receipt receipt.json and preserves pack-derived rim lighting and material textures. Saving a scene is distinct from rendering it; inspect the receipt's state and packed images.
For Resolve overlays, use taste.resolve.apply_placements with injected objects from an explicitly selected, versioned target. Set source_end_mode to the convention verified on that host. Do not assume an inclusive source end across Resolve versions. The adapter allocates overlapping effects above preserved tracks and checks every placement immediately and again after all appends. Composite integers must match the installed API; for the verified Studio 21 host, Screen is 5, not the historical builder's incorrect 22. The receipt proves in-memory placement only. Save the project, verify its checkpoint, then inspect the exact rendered output before reporting delivery.
When to Activate
- "make a video in this style" / "apply the pack" / "supplement this footage"
- Assembling generated clips into something with real edit rhythm
- Minting 3D props from a look and getting them back into the video
- Verifying that a finished piece actually matches its reference
Division of Labour
The model supplies content, motion, framing and lighting structure. The pack supplies colour and rhythm. This is measured, not stylistic preference — see taste-distillation for the numbers. Practical consequences:
- The generation prompt contains zero colour language. Add "Colour: none. Render neutral. Grading is applied afterwards."
- Keep two separate flags:
--brief(what HAPPENS: subject, action, place) and--style-steer(how it LOOKS). Merging them leaks style words into the scene ("teal" becomes a teal object) and subject words into the grade. - The model responds to local, checkable rules far better than global ones. "Backgrounds pure black and unlit; subjects blowing toward white" works; "extreme contrast" does not.
Generate TAKES, Not Shots
The obvious reading of "match the cadence" is one generation per shot. It is economically absurd. A reference averaging 0.78s/shot against an endpoint with a 4-second floor turns a 10s piece into 12 calls, 48 generated seconds for 10 used (21% efficiency), and twelve unrelated clips stitched into what should read as continuous.
Editors roll a longer take and cut inside it. Grouping shots into ~5s takes: 3 calls, 13 generated seconds, 77% efficiency, and consecutive shots that actually belong to each other because they came from the same generation.
Tell the model what shape you want, or it renders a slow locked-off push and six cuts inside it read as a stutter:
"Filmed as ONE continuous take with no hard cuts inside it. It will be cut into 6 pieces of roughly 0.8s in the edit, so the framing, subject and light must keep changing throughout — any 0.8s window has to stand alone as its own shot."
Cutting Rules
- Re-encode, never stream-copy. Stream copy only cuts on keyframes, which at 0.78s mean shot length rounds every boundary to the nearest GOP — destroying the exact thing the pipeline exists to preserve.
- When supplementing existing footage, use its own shot boundaries. Slicing a base video into contiguous pieces and playing them in order just reassembles the original: every "cut" lands mid-shot and is invisible. Measured, a 20-shot assembly registered only 12 detected cuts. Detect real boundaries and take every Nth so consecutive picks are guaranteed discontinuous. That moved a cut measurement from 1.29s to 0.83s against a 0.78s target.
- Sample shot lengths from the reference's distribution, not from its mean, so the cut inherits rhythm variance instead of flattening to even clips.
Grading Rules
- Direct measurement beats a baked LUT when you have the clip: measure it, match its L\* CDF, apply zone chroma.
grade_clip_directreached MAE 1.58 and contrast 34.0 against 34.7. - Anchor, do not CDF-match, when the clip's histogram is unlike the reference's. Forcing a 68%-black generated clip onto a busy reference histogram lifted the entire background out of black: background preservation fell to 26.0% (CDF) versus 69.0% (anchor), while MAE and contrast both still looked excellent. Default to anchored tone.
- Batch size matters. Grading 48 frames at once OOM-killed the process; 6 is safe.
Recovered fal Platform Behavior
These observations and endpoint examples came from the recovered workflow. Recheck current endpoint metadata; they are not guarantees about every future provider version. The bundled graph templates record the separately verified workflow inputs, including explicit generated-audio control.
These cost real time to discover. Check them before designing a graph.
| Limit | Detail |
|---|---|
| No 3D renderer at all | fal has image-to-3d, text-to-3d, 3d-to-3d and nothing else. Every 3d-to-3d endpoint emits another mesh. There is no 3d-to-image/3d-to-video category, so a minted GLB cannot re-enter a fal video graph. Render locally, then use fal-ai/ffmpeg-api/images-to-video. |
| compose cannot overlay | fal-ai/ffmpeg-api/compose rejects a second track with "Multiple video tracks are not supported" — and it counts an image track as a video track. It sequences one video track only. Composite locally with ffmpeg. |
| compose keyframes are milliseconds | Nothing in the response says so. A run submitted in seconds is accepted and returns a video that is 1000x too short. |
| extract-frame offers first/middle/last only | No arbitrary timestamp. Use the three as three distinct conditioning images. |
| No loops, no string concat in the DAG | Per-shot fan-out has to be authored node by node, or kept local. |
| Kling 3.0 has no reference-to-video | The v3 line is text/image/motion-control only; reference-to-video lives on the o3 line: fal-ai/kling-video/o3/pro/reference-to-video. |
| Prefixes are not uniform | bytedance/*, tripo3d/*, meshy/*, minimax/*, openai/* carry no fal-ai/ prefix. kling-video, veo3.1, flux-*, hunyuan-3d, ffmpeg-api do. |
Endpoint picks
| Slot | Best | Value alternative |
|---|---|---|
| reference→video | bytedance/seedance-2.5/reference-to-video (~$0.473/s @720p) | fal-ai/kling-video/o3/pro/reference-to-video (~$0.112/s) |
| image→3D | fal-ai/hunyuan-3d/v3.1/pro/image-to-3d ($0.375, up to 8 views) | tripo3d/h3.1/image-to-3d ($0.20) |
| text→3D | fal-ai/hunyuan-3d/v3.1/pro/text-to-3d | tripo3d/h3.1/text-to-3d |
| retopology | fal-ai/hunyuan-3d/v3.1/smart-topology ($0.75) | tripo3d/tripo/remesh (~75x cheaper) |
| part split | fal-ai/hunyuan-3d/v3.1/part (FBX only) | tripo3d/tripo/segment |
| text→image | fal-ai/nano-banana-pro ($0.15 flat) | fal-ai/flux-2-pro ($0.03/MP) |
Seedance is ~4x Kling o3's price for the same 5 seconds. It earns that on multi-reference fidelity (up to 50 mixed image/video/audio refs) and does not earn it when conditioning on a single still.
Model IDs and prices drift. Verify against fal.ai/models before promising any of them.
The 3D Branch
python mint3d.py --genre <name> --from-stills 4 --retopo --render
python mint3d.py --genre <name> --prompt "a cracked chrome visor" --render- Generate a clean plate first; do not lift from reference stills. The endpoint's stated input requirement is simple background, single object, object >50% of frame. Reference reels are the opposite of that — collages, wide shots, several subjects, burnt-in graphics — and they produce sculpted noise. Text → single-object plate → mesh costs ~$0.15 extra and is the difference between a usable mesh and a discarded one.
- Multi-view is named per-angle fields, not a list.
input_image_url(front, required), thenback_image_url,left_image_url,right_image_url,left_front_image_url,right_front_image_url,top_image_url,bottom_image_url. There is noinput_image_urlsand nomulti_viewflag — inventing them degrades every mint to single-view while appearing to work. A wrong angle label is worse than omitting the view, because the model trusts it. - Address the GLB by key, not by position. The response carries a
thumbnailPNG and amodel_urlsblock alongsidemodel_glb; taking the first URL works only until the keys reorder, and a preview PNG downloads fine — nothing fails until Blender refuses to open it. - Request PBR maps. Without them the mesh lights like painted cardboard.
- Retopologise if anyone will edit or rig it. Generated meshes are dense and chaotic.
- Render locally to close the loop. Once a turntable is frames, it is footage, and every downstream stage already handles footage — grade it, cut it, screen it as an element, or upload it as a conditioning reference. Use Blender when a binary is on PATH; keep a dependency-light software rasteriser as the default, because a headless GL context is the single most common thing missing from a container and a renderer that only works on a workstation is not part of a pipeline.
Verify, Then Believe
Every other stage claims a result. Check it, and check distribution shape, not just moments:
background— share of frame below L\10 vs the pack's figure. Compare to the reference, not* to the source clip: a generated source at 68% black is blacker than any reference in a 24–55% band, so "preserve the source's blacks" demands the wrong thing and equally excuses a lifted grade.chroma_mae— per-zone a\/b\ error, using the median (matching how the pack's targets were measured; a mean here compares a skew-sensitive statistic to a robust one and reports a definition mismatch as an error).contrast/black_point/white_pointbanding— empty L\ histogram bins between occupied ones*. Counting total empty bins does not work: a legitimately dark clip has empty highlight bins.cadence— detected mean shot length vs the reference's.
Watch the units trap: OpenCV changes Lab convention with dtype. On float32, L\ is 0–100 and a\/b\ are signed; on uint8, L\ is 0–255 and a\/b\ are biased +128. Mixing them reports chroma errors in the hundreds.
Full Chain
python pipeline.py --genre <name> --refs a.mov b.mov \
--brief "what happens" --duration 12 \
--base-video existing.mp4 --out out/FINAL.mp4mint → distill → (mint3d) → apply → forge → verify. Stages 1–3 are cached, so iterating on briefs never re-measures anything. --dry-run stubs every network call: the plan, prompts, track layout and manifest all still get exercised.
Anti-Patterns
| Don't | Why |
|---|---|
| One generation per shot | 21% efficiency, 12 unrelated clips |
| Put colour in the prompt | Measured not to work; pushes away from the neutral base the LUT wants |
| Stream-copy the cuts | Keyframe-only boundaries destroy sub-second rhythm |
| Cut a base video contiguously | Reassembles the original; every cut invisible |
| Trust compose to overlay | It cannot; it rejects the second track |
| Send seconds to compose | Silently 1000x too short |
| Ship on MAE alone | Add the background-share check |
Borrowed Footage Carries the Capture App's UI
The single worst defect found in a delivered cut: the finished video shipped someone else's like button, view counter and comment bubble, because the base footage was a screen recording and nothing cropped them out.
content_mask does not solve this and its bounding box makes it worse. Temporal variance keeps interface chrome, because chrome animates - the heart pulses, the counter ticks - so the mask marks it as moving content. Measured on three references, the mask bbox kept 100% of the width every time while the interface sat plainly in the right-hand margin.
The separating signal is the temporal median, not the variance. Footage moves, so the median of many frames averages into mush with almost no edge energy; chrome sits at fixed coordinates, so its edges survive intact. Sobel energy on the median frame lights up on chrome and goes quiet on content - measured, a right-hand column read 0.23 against an interior background of 0.03 on one reference and 0.31 against 0.15 on another.
Two implementation details that cost a cycle each:
- Trim past the innermost outlier in each outer band, not inward from the edge. Walking in while the current line is hot stops immediately, because the outermost lines are letterbox - flat black, zero edge energy - and the chrome sits inside that at 90-95% of width. The naive version trimmed 1% of frame while the like button stayed in shot.
- Scale to cover, not pad, when portrait source lands in a landscape cut. Padding 9:16 (narrower still after the UI crop) into 16:9 left ~60% of frame as black bars, one shot was nearly an empty rectangle, and it poisoned the background metric because bars are pure black. Covering loses the sides, which is the right trade for centre-framed material.
Overlay Plates Are Elements, Not Washes
A glow plate is ~4% covered by construction. Composite it at frame size and you get a small bright dot parked mid-shot - it reads as a sticker, and it was visible in a delivered cut as an unexplained coloured blob.
- Tighten each plate to its alpha bounding box first. That raises coverage from ~4% to 15-35% and hands size control to the caller instead of inheriting whatever fraction of the source frame the element happened to occupy.
- Choose wash vs element by coverage. Diffuse plates (<10% after tightening) work stretched full-frame at low opacity; concentrated ones want to be scaled to 35-70% of frame width and placed.
- Vary placement, scale and rotation per shot from a seeded RNG, so the cut stays reproducible but no two stamped shots share a mark. One plate in one spot every Nth shot reads as a watermark.
- Resolve element geometry in Python, not in ffmpeg expressions:
pad()rejects a negative offset and cannot pad below its input size, so an oversized or off-frame element kills the whole filtergraph.
Downstream Handoff (Resolve / Blender)
Always ship an editable timeline beside the mp4. The flattened video is a viewing copy and the one thing a colourist cannot work with — every cut is baked in and the shots are no longer separable. forge.py writes FCPXML 1.9 and a CMX3600 EDL referencing the individual graded shot files, so the piece lands as a timeline that can be re-cut and re-graded.
Validate the export, do not assume it: check that asset-clip offsets equal the running sum of prior durations (no gaps), that every ref resolves to a declared asset, that every media-rep src exists on disk, and that the total matches the mp4. A timeline that imports but drifts is worse than one that fails loudly.
Two things that silently destroy the work:
- Project frame rate must be set before import. Resolve locks timeline fps on first timeline creation and conforms the cadence silently. At a sub-second mean shot length that conform is visible.
- The delivered shots are already graded.
look.cubeis a normalising LUT for new material and for matching — applying it to the supplied shots double-grades them. Node 1, nothing before it, corrections after.
Ship a handoff doc with the measured targets in it (scripts/HANDOFF-TEMPLATE.md is a filled example): the zone chroma table, the cadence distribution including rhythm variance — an editor who matches the mean but not the variance produces something that reads completely differently — and an explicit "do not" list.
For Blender, scripts/blender_prop.py derives its lighting from the pack: black world with transparent film (so renders composite with no keying), key plus rim (a key alone lets the silhouette die against black), rim colour converted from the pack's peak-chroma zone via Lab→linear sRGB so the prop picks up the same cast the footage is graded to. View transform Standard, not AgX/Filmic, and no grading in Blender — AgX applies its own tone curve before the LUT ever sees the pixels, and grading twice compounds.
Bundled Code
scripts/ in this skill is a working implementation, not pseudocode. It has no project-specific assumptions: point it at any reference videos and it produces a pack.
pip install -r scripts/requirements.txt
export FAL_KEY=... # only needed for the stages that call falEvery network call is stubbed under TASTE_FORGE_DRY_RUN=1 or --dry-run, so the plan, prompts, track layout and manifest can be inspected without spending.
build/
dist/
*.egg-info/
#!/usr/bin/env python3
"""Load a minted prop into a Blender scene lit by the pack's measurements.
blender -b --python blender_prop.py -- --pack stylepacks/flashethereal \
--mesh stylepacks/flashethereal/props/prop_lifted.glb --out out/prop.blend
# or interactively, to keep working in the UI:
blender --python blender_prop.py -- --pack stylepacks/flashethereal --mesh prop.glb
This is the handoff point between the generative half of the pipeline and a
real 3D application. It exists because fal has no endpoint that renders a mesh -
the whole 3D category consumes 2D and emits 3D, or consumes 3D and emits 3D -
so anything beyond the software turntable in ``taste/render3d.py`` has to happen
here.
What it sets up, and why each piece is derived rather than guessed:
* **World is black, film is transparent.** The pack's references sit between
24% and 55% pure black; a default grey world would light the prop from every
direction and destroy the silhouette the look depends on. Transparent film
also means the render composites straight over footage with no keying.
* **Key and rim, no fill.** A single key leaves the silhouette to die against
the black world wherever the surface turns away. The rim is what keeps the
object readable, and it is the same reason the software rasteriser carries a
rim term.
* **Rim colour comes from the pack's measured signature zone**, converted from
Lab to linear sRGB - so the prop picks up the same cast the footage is graded
to instead of a colourist having to match it by eye afterwards.
* **No colour grading in Blender.** Render neutral and let ``look.cube`` do it
downstream, for exactly the reason the generation prompts carry no colour
language: grading twice compounds, and the LUT is the single source of truth.
The script sets the view transform to Standard rather than Filmic/AgX for the
same reason - AgX would apply its own tone curve before the LUT ever sees the
pixels.
"""
from __future__ import annotations
import argparse
import hashlib
import os
import tempfile
import json
import math
import sys
from pathlib import Path
def _argv() -> list[str]:
"""Blender passes script args after a bare '--'."""
return sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []
def _lab_to_linear_srgb(L: float, a: float, b: float) -> tuple[float, float, float]:
"""Lab -> linear sRGB, unclamped except at the end.
Written out rather than pulled from OpenCV because Blender ships its own
Python without the pipeline's dependencies, and because cv2's LAB2RGB
clamps internally - which is the same trap that once made an out-of-gamut
measurement read 0% when the true figure was 83%.
"""
fy = (L + 16.0) / 116.0
fx = fy + a / 500.0
fz = fy - b / 200.0
def finv(t: float) -> float:
return t ** 3 if t > 6.0 / 29.0 else 3.0 * (6.0 / 29.0) ** 2 * (t - 4.0 / 29.0)
# D65 white point.
X = 0.95047 * finv(fx)
Y = 1.00000 * finv(fy)
Z = 1.08883 * finv(fz)
r = 3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z
g = -0.9692660 * X + 1.8760108 * Y + 0.0415560 * Z
bl = 0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z
return tuple(max(0.0, min(1.0, v)) for v in (r, g, bl))
def rim_colour(pack_dir: Path) -> tuple[float, float, float]:
"""The pack's peak-chroma zone, as a linear-sRGB light colour."""
grade = pack_dir / "grade.json"
if not grade.exists():
return (0.55, 0.75, 1.0)
zones = json.loads(grade.read_text()).get("zones") or []
if not zones:
return (0.55, 0.75, 1.0)
# Zone centres for ZONE_EDGES [0,15,35,55,75,100].
centres = [7.5, 25.0, 45.0, 65.0, 87.5]
peak = max(range(len(zones)), key=lambda i: (zones[i][0] ** 2 + zones[i][2] ** 2))
L = centres[peak] if peak < len(centres) else 50.0
# Push L up: this is a LIGHT, not a surface, so it needs to be emissive
# bright while keeping the measured hue direction.
return _lab_to_linear_srgb(min(95.0, L * 2.4), zones[peak][0], zones[peak][2])
def validate_settings(frames: int, width: int, height: int, fps: float) -> None:
for name, value, limit in (("frames", frames, 108000), ("width", width, 16384),
("height", height, 16384), ("fps", fps, 240)):
if (isinstance(value, bool) or not isinstance(value, (int, float))
or not math.isfinite(value) or not 1 <= value <= limit
or (name != "fps" and int(value) != value)):
raise ValueError(f"{name} must be finite, positive and within {limit}")
def validate_output(path: Path) -> None:
if any(part.is_symlink() for part in (path, *path.parents)):
raise ValueError(f"symlink output is not allowed: {path}")
if path.exists():
raise ValueError(f"refusing to overwrite existing output: {path}")
def validate_bounds(lower, upper) -> None:
dimensions = [upper[i] - lower[i] for i in range(3)]
if (not all(math.isfinite(v) for v in (*lower, *upper))
or any(v < 0 for v in dimensions) or not 1e-9 < max(dimensions) < 1e12):
raise ValueError("mesh has invalid or empty geometry bounds")
def camera_distance(radius: float, width: int, height: int) -> float:
"""Fit the original bounding sphere with the original 50 mm / 36 mm camera."""
horizontal_half = math.atan(36 / (2 * 50))
vertical_half = math.atan(math.tan(horizontal_half) * height / width)
return max(radius * math.hypot(3.2, 0.8),
radius / math.sin(min(horizontal_half, vertical_half)) * 1.05)
def linearize_action(action) -> None:
"""Blender 4 legacy actions and Blender 5 slotted action channel bags."""
if hasattr(action, "fcurves"):
curves = action.fcurves
else:
curves = [curve for layer in action.layers for strip in layer.strips
for bag in getattr(strip, "channelbags", ()) for curve in bag.fcurves]
for curve in curves:
for point in curve.keyframe_points:
point.interpolation = "LINEAR"
def verify_render(status, render_dir: Path, frames: int) -> None:
expected = [render_dir / f"turn_{frame:04d}.png" for frame in range(1, frames + 1)]
if "FINISHED" not in status or not all(path.is_file() and path.stat().st_size > 0 for path in expected):
raise RuntimeError("Blender did not complete every requested render frame")
def _sha256(path: Path) -> str:
with path.open("rb") as stream:
return hashlib.file_digest(stream, "sha256").hexdigest()
def build(mesh: Path, pack: Path, out: Path | None, frames: int, size: int,
render_dir: Path | None, *, width: int | None = None,
height: int | None = None, fps: float = 24,
receipt: Path | None = None) -> None:
width = size if width is None else width
height = size if height is None else height
validate_settings(frames, width, height, fps)
if not mesh.is_file():
raise ValueError(f"mesh is not a regular file: {mesh}")
for path in (out, receipt, render_dir):
if path is not None:
validate_output(path)
if receipt is not None and out is None:
raise ValueError("receipt requires a saved --out scene")
if out is not None and out.suffix.lower() != ".blend":
raise ValueError("scene output must use .blend extension")
if out is not None and receipt is not None and out.absolute() == receipt.absolute():
raise ValueError("receipt and scene output must be distinct")
source_hash = _sha256(mesh)
grade = pack / "grade.json"
grade_hash = _sha256(grade) if grade.is_file() else None
import bpy
import mathutils
bpy.ops.wm.read_factory_settings(use_empty=True)
suffix = mesh.suffix.lower()
if suffix in (".glb", ".gltf"):
bpy.ops.import_scene.gltf(filepath=str(mesh))
elif suffix == ".obj":
bpy.ops.wm.obj_import(filepath=str(mesh))
elif suffix == ".fbx":
bpy.ops.import_scene.fbx(filepath=str(mesh))
else:
raise SystemExit(f"unsupported mesh format: {suffix}")
objs = [o for o in bpy.context.scene.objects if o.type == "MESH"]
if not objs:
raise SystemExit(f"no mesh geometry found in {mesh}")
mn = mathutils.Vector((float("inf"),) * 3)
mx = mathutils.Vector((-float("inf"),) * 3)
for o in objs:
for c in o.bound_box:
w = o.matrix_world @ mathutils.Vector(c)
mn = mathutils.Vector(min(mn[i], w[i]) for i in range(3))
mx = mathutils.Vector(max(mx[i], w[i]) for i in range(3))
validate_bounds(mn, mx)
center = (mn + mx) / 2.0
radius = max((mx - mn).length / 2.0, 1e-4)
print(f"[prop] {len(objs)} mesh object(s), radius {radius:.4f}")
pivot = bpy.data.objects.new("turntable_pivot", None)
bpy.context.collection.objects.link(pivot)
pivot.location = center
# Preserve imported hierarchy and world transforms, including PBR meshes.
roots = [o for o in bpy.context.scene.objects if o.parent is None and o != pivot]
bpy.context.view_layer.update()
for o in roots:
world = o.matrix_world.copy()
o.parent = pivot
o.matrix_world = world
cam_data = bpy.data.cameras.new("cam")
cam = bpy.data.objects.new("cam", cam_data)
bpy.context.collection.objects.link(cam)
bpy.context.scene.camera = cam
cam_data.lens = 50
cam_data.sensor_width = 36
cam_data.sensor_fit = "HORIZONTAL"
direction = mathutils.Vector((0.0, -3.2, 0.8)).normalized()
cam.location = center + direction * camera_distance(radius, width, height)
tr = cam.constraints.new(type="TRACK_TO")
tr.target = pivot
tr.track_axis = "TRACK_NEGATIVE_Z"
tr.up_axis = "UP_Y"
rim = rim_colour(pack)
print(f"[prop] rim colour from pack: {tuple(round(c, 3) for c in rim)}")
lights = (
("key", (radius * 2.5, -radius * 2.0, radius * 2.5), 900.0, (1.0, 1.0, 1.0)),
("rim", (-radius * 2.5, radius * 1.5, radius * 1.2), 700.0, rim),
)
for name, loc, energy, colour in lights:
ld = bpy.data.lights.new(name, type="AREA")
ld.energy = energy
ld.size = radius * 2.0
ld.color = colour
lo = bpy.data.objects.new(name, ld)
bpy.context.collection.objects.link(lo)
lo.location = center + mathutils.Vector(loc)
c = lo.constraints.new(type="TRACK_TO")
c.target = pivot
c.track_axis = "TRACK_NEGATIVE_Z"
c.up_axis = "UP_Y"
sc = bpy.context.scene
sc.render.resolution_x = int(width)
sc.render.resolution_y = int(height)
sc.render.resolution_percentage = 100
sc.render.fps = round(fps)
sc.render.fps_base = sc.render.fps / fps
sc.render.film_transparent = True
sc.render.image_settings.file_format = "PNG"
sc.render.image_settings.color_mode = "RGBA"
sc.world = bpy.data.worlds.new("black")
sc.world.use_nodes = True
sc.world.node_tree.nodes["Background"].inputs[1].default_value = 0.0
# Standard, not Filmic/AgX: look.cube is applied downstream and a second
# tone curve in front of it compounds.
sc.view_settings.view_transform = "Standard"
sc.frame_start = 1
sc.frame_end = frames
pivot.rotation_mode = "XYZ"
for i in range(frames):
pivot.rotation_euler = (0.0, 0.0, 2 * math.pi * i / frames)
pivot.keyframe_insert("rotation_euler", frame=i + 1)
linearize_action(pivot.animation_data.action)
sc.frame_set(1)
bpy.context.view_layer.update()
if render_dir:
sc.render.filepath = str(render_dir.absolute() / "turn_")
try:
sc.render.engine = "BLENDER_EEVEE_NEXT"
except TypeError:
sc.render.engine = "BLENDER_EEVEE"
if out:
out.parent.mkdir(parents=True, exist_ok=True)
# Pack textures, then publish on the same filesystem without clobbering.
bpy.ops.file.pack_all()
with tempfile.TemporaryDirectory(prefix=".taste-blender-", dir=out.parent) as temporary:
staged = Path(temporary) / "scene.blend"
bpy.ops.wm.save_as_mainfile(filepath=str(staged), check_existing=False, copy=True)
if not staged.is_file() or staged.stat().st_size == 0:
raise RuntimeError("Blender failed to save scene")
validate_output(out)
os.link(staged, out)
print(f"[prop] scene -> {out}")
if render_dir:
validate_output(render_dir)
render_dir.mkdir(parents=True, exist_ok=False)
status = bpy.ops.render.render(animation=True)
verify_render(status, render_dir, frames)
print(f"[prop] frames -> {render_dir}")
if receipt:
if _sha256(mesh) != source_hash or (_sha256(grade) if grade.is_file() else None) != grade_hash:
raise RuntimeError("input changed during scene build")
payload = {
"schema_version": 1, "blender_version": bpy.app.version_string,
"source": {"path": str(mesh.absolute()), "sha256": source_hash},
"grade": {"path": str(grade.absolute()), "sha256": grade_hash},
"scene": {"meshes": [o.name for o in objs], "mesh_count": len(objs),
"materials": sorted({slot.material.name for o in objs for slot in o.material_slots if slot.material}),
"textures": [{"name": image.name, "packed": bool(image.packed_file)}
for image in bpy.data.images if image.source == "FILE"],
"bounds": [list(mn), list(mx)], "dimensions": list(mx - mn),
"rim_colour": list(rim), "width": sc.render.resolution_x,
"height": sc.render.resolution_y, "fps": sc.render.fps / sc.render.fps_base,
"frame_start": sc.frame_start, "frame_end": sc.frame_end,
"view_transform": sc.view_settings.view_transform,
"render_engine": sc.render.engine, "render_filepath": sc.render.filepath},
"output": {"path": str(out.absolute()), "sha256": _sha256(out), "bytes": out.stat().st_size},
"saved": True, "rendered": render_dir is not None,
"render_dir": str(render_dir.absolute()) if render_dir else None,
"rendered_frame_count": frames if render_dir else 0,
"provider_execution": False, "provider_calls": 0,
}
receipt.parent.mkdir(parents=True, exist_ok=True)
validate_output(receipt)
with receipt.open("x") as stream:
json.dump(payload, stream, indent=2, allow_nan=False)
def main() -> None:
ap = argparse.ArgumentParser(description="Load a minted prop into a lit Blender scene.")
ap.add_argument("--mesh", required=True)
ap.add_argument("--pack", required=True, help="style pack dir, for the rim colour")
ap.add_argument("--out", default=None, help="save a .blend here")
ap.add_argument("--render", default=None, help="render the turntable into this dir")
ap.add_argument("--frames", type=int, default=48)
ap.add_argument("--size", type=int, default=1024)
ap.add_argument("--width", type=int, default=None, help="overrides square --size")
ap.add_argument("--height", type=int, default=None, help="overrides square --size")
ap.add_argument("--fps", type=float, default=24, help="explicit scene FPS; legacy default 24")
ap.add_argument("--receipt", default=None, help="write verified scene metadata JSON")
a = ap.parse_args(_argv())
build(Path(a.mesh), Path(a.pack), Path(a.out) if a.out else None,
a.frames, a.size, Path(a.render) if a.render else None,
width=a.width, height=a.height, fps=a.fps,
receipt=Path(a.receipt) if a.receipt else None)
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""Final stage: material in, finished video out.
python forge.py --genre flashethereal --takes gen/a.mp4 gen/b.mp4 \
--base-video existing.mp4 --overlays stills/x.png --duration 15 \
--out out/final.mp4
Takes generated clips (from the fal apply workflow, or anywhere), grades them
with the pack, cuts them at the reference's measured cadence, optionally weaves
in shots from an existing video being supplemented, composites overlay images,
and concatenates the result.
The grade happens here rather than in the prompt because that is what the
measurements support: three paid generations with escalating colour direction
moved midtone a* from +1.9 to +2.8 against a +24.9 target and never shifted
contrast off ~19 against 34.7, while applying the pack reached MAE 1.88 and
contrast 33.7 deterministically.
"""
from __future__ import annotations
import argparse
import math
import tempfile
from datetime import datetime, timezone
from pathlib import Path
import numpy as np
from taste import assemble as asm
from taste import cadence as cad_mod
from taste import frames as frame_mod
from taste import grade as grade_mod
from taste import pack as pack_mod
from taste import plates as plate_mod
from taste import timeline as tl_mod
def validate_output(out_path: Path) -> None:
"""Refuse to replace either a viewing copy or any part of its handoff."""
outputs = [out_path, *(out_path.with_suffix(s) for s in (".fcpxml", ".edl", ".json"))]
if len(set(outputs)) != len(outputs):
raise ValueError("output must have a video suffix distinct from timeline/manifest files")
for path in outputs:
if path.exists() or path.is_symlink():
raise FileExistsError(f"output already exists; choose a new --out: {path}")
def forge(
genre: str,
takes: list[str],
out: str,
root: str = "stylepacks",
base_video: str | None = None,
base_ratio: float = 0.35,
overlays: list[str] | None = None,
overlay_every: int = 4,
overlay_opacity: float = 0.3,
duration: float | None = None,
strength: float = 1.0,
grade_base: bool = True,
width: int | None = None,
height: int | None = None,
work: str = "out/forge_work",
plan: list[dict] | None = None,
fps: float | None = None,
) -> Path:
out_path = Path(out)
validate_output(out_path)
if not takes or any(not Path(t).is_file() for t in takes):
raise ValueError("all takes must be readable local files")
if base_video and not Path(base_video).is_file():
raise ValueError("base video must be a readable local file")
if any(not Path(o).is_file() for o in (overlays or [])):
raise ValueError("all overlays must be readable local files")
if fps is not None and (not math.isfinite(fps) or fps <= 0):
raise ValueError("fps must be finite and positive")
sp = pack_mod.load(genre, root=root)
tgt = grade_mod.load_stats(sp.grade_path)
cad = cad_mod.load(sp.cadence_path)
# Geometry comes from the first take unless overridden; everything else is
# normalized to it so concat does not silently fail on a size mismatch.
info0 = frame_mod.probe(takes[0])
W = width or info0.width
H = height or info0.height
FPS = fps if fps is not None else info0.fps
if not math.isfinite(FPS) or FPS <= 0:
raise ValueError("source fps must be finite and positive; provide --fps")
if W <= 0 or H <= 0:
raise ValueError("output width and height must be positive")
# Prior timelines reference these shot files. Each run owns a fresh child,
# including failed runs, so retries cannot erase an existing edit.
work_root = Path(work)
work_root.mkdir(parents=True, exist_ok=True)
work_dir = Path(tempfile.mkdtemp(prefix="run-", dir=work_root)).resolve()
print(f"forging '{genre}' -> {W}x{H} @ {FPS:g}fps")
print(f" cadence: mean {cad.mean_shot:.2f}s, {cad.cuts_per_min:.0f} cuts/min, "
f"variance {cad.rhythm_variance:.2f}")
total_target = duration or sum(frame_mod.probe(t).duration for t in takes)
# When apply.py generated these takes it already decided where the cuts
# fall, and it told the model so ("cut into 6 pieces of ~0.8s"). Re-planning
# here would silently cut somewhere else, against footage shot for the
# original plan - so the caller's plan wins when there is one.
if plan is None:
# Plan PER TAKE against each take's own length, not by splitting the
# target across an arbitrary number of groups.
#
# plan_takes() answers "how do I fill N seconds": for a 12s target it
# returns 4 groups whose shot counts taper (8, 3, 1, ...). Handing
# those groups to three 5-second takes cuts the first take into 8
# shots and the third into 1, throwing away most of the footage that
# was just paid for. Each supplied take is 5 seconds of usable
# material and should be cut as such.
plan = []
for i, t in enumerate(takes):
tdur = frame_mod.probe(t).duration
cursor, shots = 0.0, []
for d in cad.plan_shots(tdur):
if cursor + d > tdur:
break
shots.append({"start": round(cursor, 3), "duration": round(d, 3)})
cursor += d
plan.append({"index": i, "shots": shots or
[{"start": 0.0, "duration": round(tdur, 3)}]})
print(f" plan: {sum(len(t['shots']) for t in plan)} shots across "
f"{len(plan)} takes, cut to each take's own length (re-planned)")
else:
print(f" plan: {sum(len(t['shots']) for t in plan)} shots across "
f"{len(plan)} takes (from generation plan)")
# ---- grade + cut each take -------------------------------------------
gen_shots: list[Path] = []
for i, take_path in enumerate(takes):
norm = asm.normalize(take_path, work_dir / f"take{i}_norm.mp4", W, H, FPS)
graded = work_dir / f"take{i}_graded.mp4"
print(f" [take {i}] grading {Path(take_path).name} ...")
grade_mod.grade_clip_direct(norm, graded, tgt, strength=strength)
shots = plan[i % len(plan)]["shots"]
cuts = asm.cut_take(graded, shots, work_dir / f"take{i}_shots", prefix=f"g{i}", fps=FPS)
print(f" {len(cuts)} shots cut")
gen_shots.extend(cuts)
# ---- optional: shots from the video being supplemented ---------------
base_shots: list[Path] = []
if base_video and Path(base_video).exists():
print(f" [base] supplementing {Path(base_video).name} ...")
# Detect and cut off the capture app's interface before anything else
# touches this footage. Skipping it ships a like button and a view
# counter into the finished piece.
bframes = frame_mod.sample_frames(base_video, n=48, max_edge=720)
bcrop = frame_mod.crop_fractions(bframes)
kept = (bcrop[1] - bcrop[0]) * (bcrop[3] - bcrop[2])
print(f" UI crop: keeping {100 * (bcrop[3] - bcrop[2]):.0f}% wide x "
f"{100 * (bcrop[1] - bcrop[0]):.0f}% tall ({100 * kept:.0f}% of frame)")
norm = asm.normalize(base_video, work_dir / "base_norm.mp4", W, H, FPS,
crop=bcrop, fit="cover")
src = norm
if grade_base:
src = work_dir / "base_graded.mp4"
grade_mod.grade_clip_direct(norm, src, tgt, strength=strength)
bdur = frame_mod.probe(src).duration
# Use the base video's OWN shot boundaries, not synthetic ones.
#
# Slicing it into contiguous pieces and playing them in order simply
# reassembles the original: every "cut" falls mid-shot and is
# invisible. Measured that way, a 20-shot assembly registered only 12
# detected cuts, because the base segments rejoined seamlessly. Real
# boundaries make each borrowed piece an actual shot, and taking every
# Nth one guarantees a visible discontinuity between consecutive picks.
bcad = cad_mod.detect(base_video)
real = [s for s in bcad.shots if s.get("duration", 0) > 0.15]
print(f" base has {len(real)} real shots")
want = max(1, int(total_target * (base_ratio / max(1e-6, 1 - base_ratio)) / max(0.2, cad.mean_shot)))
step = max(1, len(real) // max(1, want))
picked = real[::step][:want]
flat = []
for k, s in enumerate(picked):
dur = min(float(s["duration"]), max(0.25, cad.plan_shots(cad.mean_shot * 1.2)[0]))
st = float(s["start"])
if st >= bdur - 0.1:
continue
flat.append({"start": round(st, 3), "duration": round(min(dur, bdur - st), 3)})
base_shots = asm.cut_take(src, flat, work_dir / "base_shots", prefix="b", fps=FPS)
print(f" {len(base_shots)} base shots taken (every {step}th real shot)")
order = asm.weave(gen_shots, base_shots, ratio=base_ratio) if base_shots else gen_shots
# ---- overlays ---------------------------------------------------------
ov = [o for o in (overlays or []) if Path(o).exists()]
if ov:
# Tighten every plate to its own content first. A glow plate is ~4%
# covered by construction, so compositing it at frame size puts a small
# bright dot in the middle of the shot - it reads as a sticker, not as
# light. Tightening raises coverage to 15-35% and hands size control to
# the caller.
tight = []
for o in ov:
try:
t = plate_mod.tighten(o, work_dir / "plates" / (Path(o).stem + ".png"))
tight.append((t, plate_mod.plate_coverage(t)))
except Exception:
tight.append((Path(o), 0.15))
print(f" [overlay] {len(tight)} plate(s) every {overlay_every} shots @ {overlay_opacity:.2f}")
# Deterministic variation: the same inputs give the same cut, but no two
# stamped shots share a placement. Stamping one mark in one spot every
# Nth shot is what made the earlier cut look like a watermark.
rng = np.random.default_rng(11)
anchors = ["center", "topright", "bottomleft", "topleft", "bottomright",
"left", "right", "top", "bottom"]
stamped: list[Path] = []
for i, clip in enumerate(order):
if overlay_every > 0 and i % overlay_every == 0:
plate, cov = tight[(i // max(1, overlay_every)) % len(tight)]
# Diffuse plates work as a full-frame wash; concentrated ones
# are elements and want to be placed and kept smallish.
wash = cov < 0.10
sc = float(rng.uniform(0.85, 1.0) if wash else rng.uniform(0.35, 0.7))
pos = "center" if wash else anchors[int(rng.integers(len(anchors)))]
rot = 0.0 if wash else float(rng.uniform(-0.6, 0.6))
opa = overlay_opacity * (0.75 if wash else 1.25)
dst = work_dir / f"ov_{i:03d}.mp4"
# Requested overlays are part of the output contract. A failed
# composite must not produce a successful, unstamped handoff.
stamped.append(asm.overlay(
clip, plate, dst, opacity=min(0.95, opa), scale=sc,
position=pos, rotate=rot, width=W, height=H))
continue
stamped.append(clip)
order = stamped
# ---- assemble ---------------------------------------------------------
if duration:
kept, acc = [], 0.0
for c in order:
d = frame_mod.probe(c).duration
if acc + d > duration * 1.08 and kept:
break
kept.append(c); acc += d
if kept:
print(f" trimmed {len(order)} -> {len(kept)} shots toward target {duration:.1f}s")
order = kept
out_path = Path(out)
asm.concat(order, out_path, fps=FPS)
final = frame_mod.probe(out_path)
duration_delta = final.duration - duration if duration is not None else 0.0
duration_contract = {
"policy": "cadence_target",
"requested_seconds": duration,
"actual_seconds": round(final.duration, 6),
"shortfall_seconds": round(max(0.0, -duration_delta), 6),
"overrun_seconds": round(max(0.0, duration_delta), 6),
}
if duration is not None and abs(duration_delta) + 1e-9 >= 1.0 / FPS:
print(f" WARNING: cadence target {duration:.3f}s produced {final.duration:.3f}s "
f"(shortfall {duration_contract['shortfall_seconds']:.3f}s, "
f"overrun {duration_contract['overrun_seconds']:.3f}s); "
"whole cadence shots are preserved without padding or duplication")
# Ship an EDITABLE timeline beside the flattened mp4.
#
# The mp4 is a viewing copy; it is the one thing a colourist cannot work
# with, because every cut is baked in and the shots are no longer separable.
# The FCPXML and EDL carry the same 24 cuts as real edit points referencing
# the individual graded shot files, so the piece lands in Resolve as a
# timeline that can be re-cut, re-ordered and re-graded rather than as a
# single clip somebody has to razor by hand.
#
# Shot files are kept: the timeline references them by absolute path, so
# deleting work_dir breaks the handoff even though the mp4 still plays.
tl_clips = [
{"path": str(Path(c).resolve()),
"duration": frame_mod.probe(c).duration,
"name": Path(c).stem}
for c in order
]
timelines = {}
for fmt in ("fcpxml", "edl"):
tp = tl_mod.write_timeline(
tl_clips, fps=FPS, out_path=out_path.with_suffix("." + fmt),
fmt=fmt, title=f"{genre}_cut", width=W, height=H,
)
if not Path(tp).is_file():
raise RuntimeError(f"{fmt} export did not create a timeline: {tp}")
timelines[fmt] = str(tp)
print(f" timeline -> {tp}")
asm.write_manifest(out_path.with_suffix(".json"), {
"genre": genre,
"work_directory": str(work_dir),
"created": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
"geometry": {"width": W, "height": H, "fps": FPS},
"takes": [str(t) for t in takes],
"base_video": base_video,
"base_ratio": base_ratio if base_shots else 0.0,
"overlays": ov,
"shots": len(order),
"generated_shots": len(gen_shots),
"base_shots": len(base_shots),
"duration": round(final.duration, 3),
"duration_contract": duration_contract,
"grade_strength": strength,
"timelines": timelines,
"shot_files": [str(Path(c).resolve()) for c in order],
"pack": {"contrast": tgt.contrast, "black": tgt.black_point, "white": tgt.white_point},
})
print(f"\n {len(order)} shots -> {final.duration:.2f}s @ {final.width}x{final.height}")
print(f" final -> {out_path}")
return out_path
def main() -> None:
ap = argparse.ArgumentParser(description="Assemble a finished video from generated takes.")
ap.add_argument("--genre", required=True)
ap.add_argument("--takes", required=True, nargs="+", help="generated clips to cut from")
ap.add_argument("--out", default="out/final.mp4")
ap.add_argument("--root", default="stylepacks")
ap.add_argument("--base-video", default=None, help="existing video to supplement")
ap.add_argument("--base-ratio", type=float, default=0.35, help="share of cut from base video")
ap.add_argument("--no-grade-base", action="store_true", help="leave base video ungraded")
ap.add_argument("--overlays", nargs="*", default=None, help="overlay image paths")
ap.add_argument("--overlay-every", type=int, default=4)
ap.add_argument("--overlay-opacity", type=float, default=0.3)
ap.add_argument("--duration", type=float, default=None,
help="best-effort cadence target in seconds, not an exact output duration")
ap.add_argument("--strength", type=float, default=1.0, help="0-1 grade intensity")
ap.add_argument("--width", type=int, default=None)
ap.add_argument("--take-len", type=float, default=5.0)
ap.add_argument("--fps", type=float, default=None, help="output frame rate; defaults to first take")
ap.add_argument("--work", default="out/forge_work", help="parent of preserved per-run shot directories")
ap.add_argument("--height", type=int, default=None)
a = ap.parse_args()
forge(a.genre, a.takes, a.out, a.root, a.base_video, a.base_ratio, a.overlays,
a.overlay_every, a.overlay_opacity, a.duration, a.strength,
not a.no_grade_base, a.width, a.height, work=a.work, fps=a.fps)
if __name__ == "__main__":
main()
flashethereal — handoff to Resolve and Blender
Everything below is measured from your three reference clips, not chosen. Where a number appears, it came out of mint.py and is reproducible by re-running it.
1. What you have been given
| File | What it is |
|---|---|
FINAL_v3.mp4 | Viewing copy. 33 shots, 14.12s, 1280x720 @ 24fps. Do not grade this — every cut is baked in. Passes all 7 verification checks. |
FINAL_v3.fcpxml | The same 33 cuts as a real timeline. This is the working file. |
FINAL_v3.edl | Same timeline, CMX3600, for anything that will not take FCPXML. |
out/forge_work/ | The individual graded shot files the timeline points at. Deleting this breaks the timeline even though the mp4 still plays. |
stylepacks/flashethereal/look.cube | 33³ node LUT. Validated: 35,937 rows, in gamut, monotonic neutral axis. |
stylepacks/flashethereal/plates/ | Screen-blend overlay elements on black. No keying needed. |
stylepacks/flashethereal/stills/ | Full-res frames from the longest shots. |
2. DaVinci Resolve
Import
File > Import > Timeline > Pre-Conformed EDL / FCPXML → FINAL_v3.fcpxmlIt lands as 24 clips at 1280x720 / 24fps, contiguous, no gaps — verified: total timeline length 14.542s matches the mp4 to the millisecond, 0 dangling asset references, all 24 media files present.
Set the project to 24 fps before importing. Resolve locks timeline frame rate on first timeline creation and will silently conform the cadence if the project is at 23.976 or 30. At a 0.66s mean shot length that conform is visible.
The LUT, and where it goes
look.cube is a normalising LUT: it takes neutral footage to the reference's grade. It is not a creative look on top of a grade.
Node order on the clip:
[1] look.cube ← 3D LUT, node 1, nothing before it
[2] your adjustments ← exposure/balance corrections, after
[3] creative ← anything you want on topPut it in ~/Library/Application Support/Blackmagic Design/DaVinci Resolve/LUT/ (macOS) or %APPDATA%\Blackmagic Design\DaVinci Resolve\Support\LUT\ (Windows), then right-click node 1 → 3D LUT → flashethereal.
The shots in forge_work/ are already graded. The LUT is there for new material you cut in, and for matching. If you apply it to the supplied shots you will double-grade them.
What the grade is
| Measured | |
|---|---|
| Contrast (std L\*) | 34.55 |
| Black point (1st pct) | 0.00 |
| White point (99th pct) | 99.66 |
| Background (share below L\*10) | 26.3% |
| Grain sigma | 0.0071 |
Chroma by luminance zone — this is the whole identity, and it lives in the lower midtones, not globally:
| Zone | a\* | b\* | chroma |
|---|---|---|---|
| L\*≈7.5 | −0.22 | −0.41 | 0.5 — neutral |
| *L\≈25** | +19.75 | −14.20 | 24.3 — violet/orchid, the signature |
| L\*≈45 | +18.16 | −6.75 | 19.4 |
| L\*≈65 | +2.03 | −4.22 | 4.7 |
| L\*≈87.5 | +1.16 | −1.08 | 1.6 — neutral |
Near-neutral at both ends, violet through the shadows and low mids. If you pull a global tint you will destroy this — the ends are supposed to stay clean.
Accent in the palette: #2938e7 electric blue, which is a separate accent, not part of the cast.
The cut
| Reference | Delivered cut | |
|---|---|---|
| Shots | 77 | 33 |
| Mean shot | 0.78s | 0.74s (5% off) |
| Median shot | 0.47s | — |
| p25 / p75 | 0.33s / 0.75s | — |
| Cuts/min | 77 | 81 |
| Rhythm variance (std/mean) | 1.06 | — |
Variance of 1.06 means this is not metronomic — long holds punctuated by very fast runs. If you retime, keep the variance; evenly spaced cuts at the same average will read completely differently.
The delivered cut runs 5% faster than the reference, which is inside tolerance.
The borrowed shots are UI-cropped. The references are screen recordings with a like button, a view counter and a comment bubble baked into the pixels; an earlier cut shipped all of it. The crop is detected per clip (74% wide x 85% tall on this one) from edge energy in the temporal median, and the result is scaled to cover rather than padded, so there are no black bars.
Overlay plates
plates/*/glow_*.png and streak_*.png are elements lifted onto black, sized so they cover 2–12% of frame. Composite mode Screen (or Add) — they are premultiplied against black, so the blacks drop out with no keying and no matte. They are used in the delivered cut every 3rd shot at 0.30 base opacity, each one tightened to its own content and placed at a varied scale, position and rotation. That variation is deliberate: one plate in one spot every Nth shot reads as a watermark, which is how the first cut looked.
plates/r0/grain.png is the reference's measured grain at sigma 0.0071. Use Overlay blend, not Screen. Generated footage is conspicuously clean and a clean image graded toward a grainy reference still does not read as the reference.
3. Blender
blender -b --python blender_prop.py -- \
--pack stylepacks/flashethereal \
--mesh stylepacks/flashethereal/props/<prop>.glb \
--out out/prop.blend --render out/prop_framesDrop -b to keep the UI open and keep working in the scene.
The script derives its lighting from the pack rather than guessing:
- World is black, film transparent. The references are 26% pure black; a grey world would light the prop from all directions and kill the silhouette. Transparent film means the render composites straight over footage.
- Key + rim, no fill. With a key alone the silhouette dies against black wherever the surface turns away.
- Rim colour is the pack's signature zone, Lab→linear sRGB — for this pack
(0.392, 0.236, 0.401), the same violet the footage is graded to. The prop picks up the cast instead of you matching it by eye. - View transform is Standard, not AgX/Filmic, and there is no grading in Blender.
look.cubeis the single source of truth; AgX would apply its own tone curve before the LUT ever saw the pixels, and grading twice compounds.
The prop that ships with this pack
props/helmet.glb is real: 300,000 faces, 168,217 verts, one geometry, full PBR material set (baseColor + metallicRoughness + normal). Minted live. Also in the folder: helmet_plate.png (the generated reference image it was built from) and helmet_preview.png. props/_dryrun_placeholders/ holds the old stub files — they are text, not meshes, and can be deleted.
turntables/helmet.mp4 is a 72-frame / 3s turntable rendered locally, and out/helmet_graded_cut.mp4 is that turntable graded with the pack and cut at the reference cadence — chroma MAE 1.21, contrast 23.21 → 31.83. That is the whole point of the 3D branch: once a prop is a turntable it is ordinary footage and every downstream stage already handles it.
To mint another (~$0.68), use the two-step path:
python mint3d.py --genre flashethereal --plate \
--prompt "a cracked chrome visor" --render--plate generates a clean single-object image first and meshes that. The endpoint's own guidance is "simple background, single object, object >50% of frame" — the pack's stills are glitch collages with several subjects, which is close to the worst possible input, so lifting a prop straight from them yields sculpted noise. The extra $0.15 is the difference between a usable mesh and a discarded one.
Multi-view is the other big lever, and it is named per-angle fields (back_image_url, left_front_image_url, …) — not a list. A wrong angle label is worse than omitting the view, because the model trusts it.
fal cannot render a mesh. Its 3D category only consumes 2D and emits 3D, or consumes 3D and emits 3D — there is no 3d-to-image or 3d-to-video endpoint at all. That is why rendering happens here or in taste/render3d.py, and it is not an oversight to route around.
4. Things that will bite you
| Don't | Why |
|---|---|
| Grade the delivered shots again | They are already graded; the LUT is for new material |
| Apply a global tint | The signature is zone-local; both ends are meant to stay neutral |
| Import at 23.976 or 30 fps | Resolve conforms silently and the cadence goes with it |
Delete out/forge_work/ | The timeline references those files by absolute path |
| Space the cuts evenly | Variance 1.06 is the rhythm; the average alone is not |
| Screen the grain plate | Grain wants Overlay; Screen lifts the blacks you just protected |
| Trust the mp4 as a master | It is a viewing copy with every cut baked in |
MIT License
Copyright (c) 2026 Affaan Mustafa
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
#!/usr/bin/env python3
"""Mint a style pack from reference videos. Stage 1 of taste-forge.
This stage is deliberately offline: no API keys, no model calls, no network.
Everything here is numeric analysis of the reference footage, which means it
is cheap, deterministic, and re-runnable. The expensive generative work
happens later, against the pack this produces.
python mint.py --genre flashethereal --refs a.mp4 b.mp4 c.mp4
Re-running with the same references reproduces the same pack byte-for-byte
apart from timestamps, so a pack can be regenerated rather than backed up.
"""
from __future__ import annotations
import argparse
import sys
from pathlib import Path
import numpy as np
from taste import cadence as cad_mod
from taste import frames as frame_mod
from taste import grade as grade_mod
from taste import pack as pack_mod
from taste import plates as plate_mod
def mint(
genre: str,
refs: list[str],
root: str = "stylepacks",
lut_size: int = 33,
strength: float = 1.0,
frames_per_ref: int = 48,
max_stills: int = 12,
mask_ui: bool = True,
) -> pack_mod.StylePack:
sp = pack_mod.create(genre, root=root)
print(f"minting '{genre}' from {len(refs)} reference(s) -> {sp.dir}")
pooled_pixels: list[np.ndarray] = []
pooled_frames: list[list[np.ndarray]] = []
noise_frames: list[np.ndarray] = []
cadences: list[cad_mod.Cadence] = []
mask_report: list[str] = []
for i, ref in enumerate(refs):
ref_path = Path(ref)
if not ref_path.exists():
print(f" !! missing reference, skipping: {ref}", file=sys.stderr)
continue
ref_id = f"genre1_{i + 1}" if i else "genre1"
print(f" [{ref_id}] {ref_path.name}")
fr = frame_mod.sample_frames(ref_path, n=frames_per_ref)
if mask_ui:
m = frame_mod.content_mask(fr)
y0, y1, x0, x1 = frame_mod.mask_bbox(m)
pooled_pixels.append(frame_mod.apply_mask(fr, m))
noise_frames.extend(f[y0:y1, x0:x1] for f in fr[:8])
mask_report.append(f"{100 * m.mean():.0f}%")
print(f" masked to {100 * m.mean():.0f}% moving pixels "
f"(dropped static UI / letterbox)")
else:
pooled_pixels.append(np.concatenate([f.reshape(-1, 3) for f in fr]))
noise_frames.extend(fr[:8])
pooled_frames.append(fr)
c = cad_mod.detect(ref_path)
cadences.append(c)
print(f" {c.n_shots} shots, mean {c.mean_shot:.2f}s, {c.cuts_per_min:.0f} cuts/min")
# Stills come from the longest shots of each reference, spread across
# the whole set rather than taken from whichever ref happens to be first.
ts = cad_mod.keyframe_timestamps(c, limit=max(1, max_stills // max(1, len(refs))))
wrote = frame_mod.export_stills(ref_path, sp.stills_dir, ts, prefix=ref_id)
print(f" {len(wrote)} stills")
sp.add_ref(ref_id, str(ref_path), c.total_duration, c.n_shots)
if not pooled_pixels:
raise SystemExit("no readable references - nothing to mint")
print(" analyzing grade across pooled frames ...")
stacked = np.concatenate(pooled_pixels, axis=0)
g = grade_mod.analyze_pixels(stacked, noise_frames=noise_frames)
merged = cad_mod.merge(cadences)
print(f" baking {lut_size}^3 LUT ...")
cube = grade_mod.bake_cube(g, size=lut_size, strength=strength, title=genre)
grade_mod.write_cube(sp.lut_path, cube)
# Overlay plates - the composable assets, as distinct from the stills,
# which only ever condition the generator.
plate_frames = []
for pix in pooled_frames[:3]:
plate_frames.extend(pix)
plate_dir = sp.dir / "plates"
made = plate_mod.mint_plates(plate_frames, plate_dir, noise_sigma=g.noise_sigma)
print(f" minted {len(made)} overlay plate(s) -> {plate_dir}")
sp.write_json(sp.grade_path, g.to_dict())
cad_mod.save(merged, sp.cadence_path)
sp.manifest["mint"] = {
"lut_size": lut_size,
"strength": strength,
"pixels_analyzed": int(stacked.shape[0]),
"ui_masked": mask_ui,
}
sp.save()
_report(g, merged, sp)
return sp
_HUE_WHEEL = [
(0, "magenta"), (30, "warm pink"), (60, "amber"), (90, "yellow-green"),
(120, "green"), (150, "teal-green"), (180, "cyan"), (210, "steel blue"),
(240, "blue"), (270, "violet"), (300, "periwinkle violet"), (330, "orchid"),
]
def _hue_name(a: float, b: float) -> str:
"""Rough perceptual name for a Lab a*/b* direction."""
import math
if (a * a + b * b) ** 0.5 < 3.0:
return "near-neutral"
ang = math.degrees(math.atan2(b, a)) % 360.0
return min(_HUE_WHEEL, key=lambda h: min(abs(ang - h[0]), 360 - abs(ang - h[0])))[1]
def _report(g: grade_mod.GradeStats, c: cad_mod.Cadence, sp: pack_mod.StylePack) -> None:
print(f"\n === {sp.name} ===")
print(f" black/white pt : {g.black_point:.1f} / {g.white_point:.1f} (L*)")
print(f" contrast : {g.contrast:.1f}")
print(f" saturation : {g.saturation:.1f}")
print(f" cast : warmth {g.warmth:+.1f} tint {g.tint:+.1f}")
print(f" grain sigma : {g.noise_sigma:.4f}")
print(f" palette : {', '.join(h for h, _ in g.palette[:5])}")
if g.zones:
# Report the whole curve, not just the endpoints. Comparing only the
# darkest and lightest zones is actively misleading: both ends tend
# toward neutral (there is little room for chroma near black or near
# white), so a look whose entire color identity lives in the midtones
# reads as "uniform cast" when it is anything but.
print(" chroma by zone :")
peak_i, peak_c = 0, 0.0
for i, (zl, z) in enumerate(zip(grade_mod.ZONE_CENTERS, g.zones)):
chroma = (z[0] ** 2 + z[2] ** 2) ** 0.5
if chroma > peak_c:
peak_i, peak_c = i, chroma
bar = "#" * min(40, int(chroma / 1.5))
print(f" L~{zl:5.1f} a*{z[0]:+7.2f} b*{z[2]:+7.2f} {bar}")
pz = g.zones[peak_i]
tail = (
", neutral at both ends"
if peak_i not in (0, len(g.zones) - 1)
else ""
)
print(
f" signature : {_hue_name(pz[0], pz[2])} at "
f"L~{grade_mod.ZONE_CENTERS[peak_i]:.0f}{tail}"
)
print(f" cadence : {c.n_shots} shots, mean {c.mean_shot:.2f}s, "
f"{c.cuts_per_min:.0f} cuts/min, variance {c.rhythm_variance:.2f}")
print(f" stills / props : {len(sp.stills())} / {len(sp.props())}")
plates = sorted((sp.dir / "plates").glob("*.png")) if (sp.dir / "plates").exists() else []
print(f" overlay plates : {len(plates)} ({', '.join(p.stem for p in plates[:4])}"
f"{' ...' if len(plates) > 4 else ''})")
print(f"\n pack -> {sp.dir}")
print(f" LUT -> {sp.lut_path} (drag into Resolve as a node LUT)")
def main() -> None:
ap = argparse.ArgumentParser(description="Mint a style pack from reference videos.")
ap.add_argument("--genre", required=True, help="pack name, e.g. flashethereal")
ap.add_argument("--refs", required=True, nargs="+", help="reference video paths")
ap.add_argument("--root", default="stylepacks")
ap.add_argument("--lut-size", type=int, default=33, choices=[17, 25, 33, 65])
ap.add_argument("--strength", type=float, default=1.0,
help="0-1; how hard to push toward the reference look")
ap.add_argument("--frames-per-ref", type=int, default=48)
ap.add_argument("--max-stills", type=int, default=12)
ap.add_argument("--no-mask-ui", action="store_true",
help="disable temporal-variance masking of static screen-recording UI")
a = ap.parse_args()
mint(a.genre, a.refs, a.root, a.lut_size, a.strength, a.frames_per_ref,
a.max_stills, mask_ui=not a.no_mask_ui)
if __name__ == "__main__":
main()
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"
[project]
name = "ecc-tasteforge"
version = "1.0.0"
description = "ECC reusable TasteForge media contracts and creative adapters"
requires-python = ">=3.9"
license = {file = "LICENSE"}
dependencies = []
[project.optional-dependencies]
media = ["numpy", "Pillow", "pixelsort"]
capcut = ["pycapcut"]
manim = ["manim"]
[project.scripts]
tasteforge = "tasteforge.cli:main"
[tool.setuptools.packages.find]
where = ["."]
include = ["tasteforge*"]
[tool.setuptools.package-data]
tasteforge = ["fixtures/flashethereal/*", "README.md"]
# Install only for separately authorized provider execution.
-r requirements.txt
# subscribe(client_timeout=...) exists from 0.13.0; older releases raise
# TypeError, which falapi would report as an unknown job acceptance.
fal-client>=0.13.0
numpy
opencv-python-headless
scenedetect[opencv]
requests
trimesh
"""Compatibility import for the canonical ECC Resolve adapter.
Alias the module itself so integrations that patch this import path continue
patching the globals used by the canonical implementation.
"""
import sys
from tasteforge import resolve as _canonical
sys.modules[__name__] = _canonical
"""TasteForge: a repeatable taste-driven video workflow.
Canonicalizes the recovered TasteForge/FAL-video flow (2026-08) into a
maintained, stdlib-only package:
* deterministic schemas for interviews, style packs, timelines, and reports;
* offline inspect / validate / interview / distill / apply / export workflows;
* provider (Fal) integrations as optional adapters that FAIL CLOSED - this
package performs no network calls and never claims a provider workflow is
saved merely because a local reference exists.
Raw recovered sources stay outside Git; only a small documented metadata
fixture ships under ``tasteforge/fixtures/`` (see the ECC skill SOURCE.md).
"""
from __future__ import annotations
__version__ = "1.0.0"
__all__ = [
"apply",
"cli",
"contract",
"distill",
"export",
"interview",
"pack",
"providers",
"provenance",
"schema",
"timeline",
"workflow",
]
"""Entry point: python3 -m tasteforge <command>."""
from __future__ import annotations
import sys
from .cli import main
if __name__ == "__main__":
sys.exit(main())
MEASURED GROUND TRUTH (from numeric analysis of all sampled frames across the reference set). These values are FACTS. Do not contradict them, do not call this footage neutral or ungraded:
- black point L*0.0, white point L*99.7, contrast (std L*) 34.7
- global cast: a*+9.0 (green<->magenta), b*-11.2 (blue<->yellow)
- chroma by luminance zone -> L*8: a*+0.5 b*-1.5; L*25: a*+35.4 b*-44.7; L*45: a*+23.1 b*-17.7; L*65: a*+2.9 b*-10.0; L*88: a*-1.0 b*-0.5
- dominant palette: #131215, #e4e4eb, #67505b, #b19b9c, #1214f4
- cut rhythm: 77 shots, mean 0.78s, 77 cuts/min, rhythm variance 1.06
Your job is to describe HOW this measured grade manifests visually, not whether it exists.
Write for a generative video model as DIRECTIVE instructions.
BANNED words: varied, mixed, dynamic, various, inconsistent, no consistent, some, often, sometimes, likely.
Every field must COMMIT to one specific choice. If the references genuinely differ, pick the DOMINANT one and state it."""Optional local media tools; dependencies are loaded only by the selected tool."""
Source and verification
Recovered from the user's latest ecc-taste-skills_1.zip attachment to the Claude conversation Video workflow architecture. Archive SHA-256: 5e0dc440df4dcf6b2082a7dd59e1d6e9cc11d10166d4e1a19dc6c96478f4d2c8.
The archive's README-MERGE.md identifies the two standalone skill script directories as the implementation. This import preserves the measured grade, reference cadence, median-edge UI crop, scale-to-cover normalization, alpha-bounded overlay plates and seeded placement logic from that source. Raw media, signed provider responses and project files are not bundled.
Focused continuation fixes address observed execution failures: script paths outside the source directory, retained editable shot media, explicit output FPS, provider tier forwarding, existing-take passthrough, measured zero background targets, packed PBR textures, Blender slotted actions and exact Resolve overlay readback. Original and retopologized meshes are retained as separate assets. Provider calls require explicit live opt-in and ambiguous submissions are not automatically repeated.
taste-distillation retains its own taste/ helpers so that skill can be installed independently, as the original bundle intended. The transport copies are checked for equality by regression tests. ECC owns the reusable tasteforge engine, including interview/schema contracts, workflow planning, asset receipts and the Resolve adapter. The legacy taste.resolve import delegates to that same adapter. ito-video consumes the packaged ECC engine as an example project.
Verification uses tests/test_taste_*.py and the dedicated taste workflow CI. Actual application checks additionally exercised a full textured GLB in Blender 5.1 and overlay placement in Resolve Studio 21. These are distinct from the offline test suite and from artistic approval of a finished video.
The metadata-only tasteforge/fixtures/flashethereal fixture comes from the earlier tasteforge (4).zip archive, SHA-256 ef06a606d3b528fbd939b05fadc25bf6674073a1e05a01e3aa6b9c9416fd6284. It includes no source media or look.cube; original source media stays outside the package.
Which skills are related to taste-application?
Taste Application skill FAQ
Is Taste Application safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
Add a taste-application badge
Show developers this skill is listed on Skillselion. Paste this into your README.