Skip to content

ReShot — copy the shot, not the actors. Video → depth map, OpenPose skeleton or canny lines for Seedance 2.0/2.5 reference video, MiniMax H3 Fun ControlNet and Wan VACE. Apache-2.0. Open-sourced by Maosika 猫斯卡 (www.maosika.com), the AI short-drama production system.

lint: ruff fixes after the rename (import/__all__ order) + two pre-existing format nits

wangfenga464168494ee
diff --git a/reshot/__init__.py b/reshot/__init__.py
index f930d3d..724c930 100644
--- a/reshot/__init__.py
+++ b/reshot/__init__.py
@@ -21,7 +21,7 @@ os.environ.setdefault("PYTORCH_MPS_HIGH_WATERMARK_RATIO", "0.6")
from ._version import __version__
from .config import RunConfig
-from .errors import BackendError, ReshotError, InputError, RamBudgetError, ToolMissingError
+from .errors import BackendError, InputError, RamBudgetError, ReshotError, ToolMissingError
from .io import probe_video, read_video, write_gray_video
from .pipeline import Plan, RunResult, extract, plan, run
from .planning import memory_verdict, processing_max_res
@@ -31,10 +31,10 @@ from .targets import TARGETS, Target, center_crop, fit_dimensions
__all__ = [
"TARGETS",
"BackendError",
- "ReshotError",
"InputError",
"Plan",
"RamBudgetError",
+ "ReshotError",
"RunConfig",
"RunResult",
"Target",
diff --git a/reshot/pipeline.py b/reshot/pipeline.py
index b4d4d27..5253886 100644
--- a/reshot/pipeline.py
+++ b/reshot/pipeline.py
@@ -180,8 +180,11 @@ def run(cfg: RunConfig, reporter: Reporter | None = None) -> RunResult:
if (p.out_h, p.out_w) != (h, w):
rep.step("size", f"{w}x{h} → {p.out_w}x{p.out_h} (multiple of {target.multiple})")
if target.min_pixels and p.out_w * p.out_h < target.min_pixels:
- rep.step("warn", f"{p.out_w}x{p.out_h} is below {target.key}'s minimum of {target.min_pixels:,} pixels "
- "— the API will reject it; use a larger source or raise --max-res")
+ rep.step(
+ "warn",
+ f"{p.out_w}x{p.out_h} is below {target.key}'s minimum of {target.min_pixels:,} pixels "
+ "— the API will reject it; use a larger source or raise --max-res",
+ )
out = write_gray_video(
upsample_frames(gray, p.out_h, p.out_w), cfg.output, fps, crf=cfg.crf, size=(p.out_h, p.out_w)
)
diff --git a/reshot/targets.py b/reshot/targets.py
index 6be59a9..28e0294 100644
--- a/reshot/targets.py
+++ b/reshot/targets.py
@@ -28,8 +28,9 @@ TARGETS: dict[str, Target] = {
# the official parameter page: mp4 H.264, fps 24–60, per-clip 2–15 s on 2.0 (2–30 s on
# 2.5), aspect 0.4–2.5, side 300–6000 px, total pixels ≥ 407,696, file ≤ 200 MB.
# The depth map goes in as @视频N and the prompt asks for its motion and camera.
- "seedance": Target("seedance", 24.0, 16, 15.0,
- "Seedance 2.0/2.5 reference video (@视频N: motion + camera)", min_pixels=407_696),
+ "seedance": Target(
+ "seedance", 24.0, 16, 15.0, "Seedance 2.0/2.5 reference video (@视频N: motion + camera)", min_pixels=407_696
+ ),
# MiniMax-H3-Fun-Controlnet-Union: 24 fps fixed, H/W multiples of 32, ≤15 s.
"h3": Target("h3", 24.0, 32, 15.0, "MiniMax H3 Fun ControlNet (depth/pose/canny/hed/mlsd)"),
# Wan 2.1 VACE control videos: 16 fps, H/W multiples of 16.