Skip to content

Instantly share code, notes, and snippets.

https://gist.github.com/SqrtRyan/b4afa6d03682f7f32edd27bb76a89201
!ffmpeg -y \
-start_number . -i "*.%04d.exr" -frames:v <N> \
-vf "format=gbrapf32le,geq=\
r='0.432699*(log(p(X\,Y)+0.037584)/2.30258509299)+0.616596':\
g='0.432699*(log(p(X\,Y)+0.037584)/2.30258509299)+0.616596':\
b='0.432699*(log(p(X\,Y)+0.037584)/2.30258509299)+0.616596',\
format=yuv444p10le" \
-c:v prores_ks -profile:v 4 -pix_fmt yuv444p10le -vendor apl0 \
output.mov
# /// script
# dependencies = [
# "rp",
# "nflx-mml-common-fs",
# "nflx-mml-common-types",
# "nflx-mml-common-io",
# ]
# ///
import rp
import rp
stagger = 5
session_name = "Workbench"
workbench_command = 'tmux a -d'
query_url = "https://console.netflix.net/api/v1/workbenches"
workbench_json = rp.curl_json(query_url, cookies="chrome")
workbench_ids = [x["id"] for x in workbench_json["items"] if x["state"] == "running"]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! CRITICAL: DUMP FOLDER ISOLATION (NEVER BREAK THIS) !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Dumps live in `~/CleanCode/Dumps/` — each subfolder is a self-contained, portable project.
If isolation breaks, the dump becomes non-portable and everything falls apart.
**At the start of every conversation, check if your working directory is inside
`~/CleanCode/Dumps/`. If so, you are in a dump and these rules apply.**
import rp
# https://gist.github.com/SqrtRyan/c33e4e40ccf74714a20c229a13c717fe
from PIL import Image
import rp
import cv2
import numpy as np
import torch
import torchvision.transforms as T
"""
Nanobanana edit quality filter — minimal, self-contained.
pip install numpy imagehash pillow
>>> from filter_sample import filter_pair
>>> filter_pair('before.png', 'after.png')
True # True = keep (good edit), False = reject (bad edit)
Derived from .claude_auto_score/best_detector.py. [ <--- useful for Ryan]
"""
Nanobanana edit quality filter — minimal, self-contained.
pip install numpy imagehash rp
>>> from filter_sample import filter_pair
>>> filter_pair('before.png', 'after.png')
True # True = keep (good edit), False = reject (bad edit)
Derived from .claude_auto_score/best_detector.py.
"""
Nanobanana edit quality filter — minimal, self-contained.
pip install numpy imagehash rp
>>> from filter_sample import filter_pair
>>> filter_pair('before.png', 'after.png')
True # True = keep (good edit), False = reject (bad edit)
Derived from .claude_auto_score/best_detector.py.
"""
Nanobanana edit quality filter — minimal, self-contained.
pip install numpy imagehash rp
>>> from filter_sample import filter_pair
>>> filter_pair('before.png', 'after.png')
True # True = keep (good edit), False = reject (bad edit)
Derived from .claude_auto_score/best_detector.py.