reshot 0.3.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. reshot-0.3.7/LICENSE +202 -0
  2. reshot-0.3.7/NOTICE +12 -0
  3. reshot-0.3.7/PKG-INFO +62 -0
  4. reshot-0.3.7/README.md +174 -0
  5. reshot-0.3.7/docs/PYPI.md +22 -0
  6. reshot-0.3.7/pyproject.toml +66 -0
  7. reshot-0.3.7/reshot/__init__.py +58 -0
  8. reshot-0.3.7/reshot/_version.py +1 -0
  9. reshot-0.3.7/reshot/backends/__init__.py +23 -0
  10. reshot-0.3.7/reshot/backends/base.py +34 -0
  11. reshot-0.3.7/reshot/backends/fake.py +28 -0
  12. reshot-0.3.7/reshot/backends/vda.py +140 -0
  13. reshot-0.3.7/reshot/cli.py +169 -0
  14. reshot-0.3.7/reshot/config.py +62 -0
  15. reshot-0.3.7/reshot/errors.py +45 -0
  16. reshot-0.3.7/reshot/io.py +196 -0
  17. reshot-0.3.7/reshot/pipeline.py +435 -0
  18. reshot-0.3.7/reshot/planning.py +81 -0
  19. reshot-0.3.7/reshot/postprocess.py +73 -0
  20. reshot-0.3.7/reshot/py.typed +0 -0
  21. reshot-0.3.7/reshot/reporter.py +27 -0
  22. reshot-0.3.7/reshot/targets.py +53 -0
  23. reshot-0.3.7/reshot/third_party/__init__.py +0 -0
  24. reshot-0.3.7/reshot/third_party/video_depth_anything/LICENSE +201 -0
  25. reshot-0.3.7/reshot/third_party/video_depth_anything/__init__.py +0 -0
  26. reshot-0.3.7/reshot/third_party/video_depth_anything/dinov2.py +415 -0
  27. reshot-0.3.7/reshot/third_party/video_depth_anything/dinov2_layers/__init__.py +11 -0
  28. reshot-0.3.7/reshot/third_party/video_depth_anything/dinov2_layers/attention.py +83 -0
  29. reshot-0.3.7/reshot/third_party/video_depth_anything/dinov2_layers/block.py +252 -0
  30. reshot-0.3.7/reshot/third_party/video_depth_anything/dinov2_layers/drop_path.py +35 -0
  31. reshot-0.3.7/reshot/third_party/video_depth_anything/dinov2_layers/layer_scale.py +28 -0
  32. reshot-0.3.7/reshot/third_party/video_depth_anything/dinov2_layers/mlp.py +41 -0
  33. reshot-0.3.7/reshot/third_party/video_depth_anything/dinov2_layers/patch_embed.py +89 -0
  34. reshot-0.3.7/reshot/third_party/video_depth_anything/dinov2_layers/swiglu_ffn.py +63 -0
  35. reshot-0.3.7/reshot/third_party/video_depth_anything/dpt.py +160 -0
  36. reshot-0.3.7/reshot/third_party/video_depth_anything/dpt_temporal.py +125 -0
  37. reshot-0.3.7/reshot/third_party/video_depth_anything/motion_module/__init__.py +0 -0
  38. reshot-0.3.7/reshot/third_party/video_depth_anything/motion_module/attention.py +429 -0
  39. reshot-0.3.7/reshot/third_party/video_depth_anything/motion_module/motion_module.py +321 -0
  40. reshot-0.3.7/reshot/third_party/video_depth_anything/util/__init__.py +0 -0
  41. reshot-0.3.7/reshot/third_party/video_depth_anything/util/align.py +74 -0
  42. reshot-0.3.7/reshot/third_party/video_depth_anything/util/blocks.py +162 -0
  43. reshot-0.3.7/reshot/third_party/video_depth_anything/util/transform.py +158 -0
  44. reshot-0.3.7/reshot/third_party/video_depth_anything/video_depth.py +163 -0
  45. reshot-0.3.7/reshot/third_party/video_depth_anything/video_depth_stream.py +161 -0
  46. reshot-0.3.7/reshot.egg-info/PKG-INFO +62 -0
  47. reshot-0.3.7/reshot.egg-info/SOURCES.txt +55 -0
  48. reshot-0.3.7/reshot.egg-info/dependency_links.txt +1 -0
  49. reshot-0.3.7/reshot.egg-info/entry_points.txt +2 -0
  50. reshot-0.3.7/reshot.egg-info/requires.txt +15 -0
  51. reshot-0.3.7/reshot.egg-info/top_level.txt +1 -0
  52. reshot-0.3.7/setup.cfg +4 -0
  53. reshot-0.3.7/tests/test_io.py +102 -0
  54. reshot-0.3.7/tests/test_model_smoke.py +49 -0
  55. reshot-0.3.7/tests/test_pipeline.py +164 -0
  56. reshot-0.3.7/tests/test_planning.py +47 -0
  57. reshot-0.3.7/tests/test_postprocess.py +86 -0
reshot-0.3.7/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
reshot-0.3.7/NOTICE ADDED
@@ -0,0 +1,12 @@
1
+ ReShot
2
+ Copyright 2026 Maosika 猫斯卡 (https://www.maosika.com)
3
+
4
+ This product includes software developed by Bytedance Ltd. and/or its affiliates:
5
+ Video Depth Anything (https://github.com/DepthAnything/Video-Depth-Anything),
6
+ licensed under the Apache License 2.0. It is vendored, unmodified except for
7
+ two import lines, under reshot/third_party/video_depth_anything/.
8
+
9
+ Model weights are downloaded at runtime from Hugging Face and carry their own licences:
10
+ depth-anything/Video-Depth-Anything-Small Apache-2.0 (default; commercial use OK)
11
+ depth-anything/Video-Depth-Anything-Base CC-BY-NC-4.0 (opt-in; non-commercial)
12
+ depth-anything/Video-Depth-Anything-Large CC-BY-NC-4.0 (opt-in; non-commercial)
reshot-0.3.7/PKG-INFO ADDED
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: reshot
3
+ Version: 0.3.7
4
+ Summary: ReShot — copy the shot, not the actors. Video → depth map for Seedance 2.0/2.5 reference video, MiniMax H3 Fun ControlNet and Wan VACE. Open-sourced by Maosika 猫斯卡 (www.maosika.com), the AI short-drama production system.
5
+ Author: Maosika 猫斯卡
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/maosika-ai/reshot
8
+ Project-URL: Documentation, https://github.com/maosika-ai/reshot/blob/main/docs/USAGE.md
9
+ Project-URL: ComfyUI nodes, https://github.com/maosika-ai/ComfyUI-ReShot
10
+ Project-URL: Changelog, https://github.com/maosika-ai/reshot/blob/main/CHANGELOG.md
11
+ Project-URL: Maosika, https://www.maosika.com
12
+ Keywords: video,depth,controlnet,video-generation,depth-map,depth-anything,seedance,minimax-h3,ai-short-drama,maosika
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Multimedia :: Video
19
+ Classifier: Topic :: Multimedia :: Graphics
20
+ Classifier: Intended Audience :: End Users/Desktop
21
+ Classifier: Operating System :: OS Independent
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ License-File: NOTICE
26
+ Requires-Dist: torch>=2.1
27
+ Requires-Dist: torchvision>=0.16
28
+ Requires-Dist: numpy>=1.24
29
+ Requires-Dist: opencv-python-headless>=4.8
30
+ Requires-Dist: einops>=0.4
31
+ Requires-Dist: easydict
32
+ Requires-Dist: tqdm
33
+ Requires-Dist: huggingface_hub>=0.20
34
+ Provides-Extra: ffmpeg
35
+ Requires-Dist: imageio-ffmpeg>=0.4.7; extra == "ffmpeg"
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest>=8; extra == "dev"
38
+ Requires-Dist: ruff; extra == "dev"
39
+ Dynamic: license-file
40
+
41
+ # ReShot
42
+
43
+ **Copy the shot, not the actors.**
44
+
45
+ ReShot turns a reference video into a depth-map video (near = white, far = black), so Seedance, MiniMax H3 or Wan can repeat its choreography and camera moves with your own characters.
46
+
47
+ ```bash
48
+ pip install reshot
49
+ reshot reference.mp4 -o depth.mp4 --target seedance
50
+ ```
51
+
52
+ - Presets for **Seedance 2.0 / 2.5** reference video (`--target seedance`), **MiniMax H3** (`h3`), **Wan 2.1 VACE** (`wan`).
53
+ - `--quality fast` (default; the model sees 644×364 for 16:9, ~3 GB VRAM) or `full` (924×518, ~11 GB).
54
+ - Depth normalised once over the whole clip — no flicker; frames picked by timestamp; sizes cropped to the model's grid, never padded.
55
+ - Batch a folder in one model load: `reshot clips/*.mp4 -o depth/`.
56
+ - Python API: `from reshot import RunConfig, run`.
57
+ - Apache-2.0, including the default model (Video Depth Anything Small).
58
+ - ComfyUI nodes: https://github.com/maosika-ai/ComfyUI-ReShot
59
+
60
+ Full guide, demo, measured performance and the prompts that made the demo takes: **https://github.com/maosika-ai/reshot**
61
+
62
+ Open-sourced by [Maosika 猫斯卡](https://www.maosika.com), the AI short-drama production system — from a one-line idea to episodic script, character sheets, scene images and every shot rendered with Seedance and MiniMax H3. https://www.maosika.com
reshot-0.3.7/README.md ADDED
@@ -0,0 +1,174 @@
1
+ <h1 align="center">ReShot</h1>
2
+ <p align="center"><b>Copy the shot, not the actors.</b></p>
3
+ <p align="center">ReShot turns a reference video into a depth map, so Seedance or MiniMax H3 can repeat its choreography and camera moves — with your own characters in it.</p>
4
+
5
+ <p align="center"><img src="docs/demo-fight.gif" width="720" alt="a fight scene, its depth map, and three new takes generated from it"></p>
6
+ <p align="center"><sub>Top: the reference and its depth map. Bottom: three takes generated from that depth map — two women, one rabbit. Same moves, same camera. <a href="docs/demo-fight.mp4">Full-resolution clip</a>.</sub></p>
7
+
8
+ <p align="center"><a href="README.zh-CN.md">中文</a> · <a href="docs/USAGE.md">User guide</a> · <a href="https://github.com/maosika-ai/ComfyUI-ReShot">ComfyUI nodes</a> · <a href="https://huggingface.co/spaces/maosika/reshot">Hugging Face</a> · <a href="CHANGELOG.md">Changelog</a></p>
9
+ <p align="center">
10
+ <a href="https://github.com/maosika-ai/reshot/actions/workflows/ci.yml"><img src="https://github.com/maosika-ai/reshot/actions/workflows/ci.yml/badge.svg" alt="ci"></a>
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" alt="Apache-2.0"></a>
12
+ <img src="https://img.shields.io/badge/runs%20on-CUDA%20%C2%B7%20Apple%20Silicon%20%C2%B7%20CPU-555" alt="platforms">
13
+ </p>
14
+
15
+ ---
16
+
17
+ ## The problem
18
+
19
+ You have a clip whose fight, dance or camera move is exactly what you want in your own AI video. There are two ways to get it, and both fail:
20
+
21
+ - **Feed the clip to the video model as a reference.** It copies the faces, the clothes and the look along with the moves. If the clip has real people in it, the platform's content check may refuse it outright.
22
+ - **Describe the moves in words.** "She kicks off the wall, grabs a pipe, throws the big guy over her shoulder" — the model gives you a different fight every time, and the camera never does what you said.
23
+
24
+ ## What ReShot does
25
+
26
+ ReShot takes an `.mp4` in and writes an `.mp4` out. The output is a **depth map video**: every frame is grey, near things are white, far things are black. It keeps where everyone stands, how big they are, how they move and how the camera moves. It throws away faces, clothes, lighting and style.
27
+
28
+ <p align="center"><img src="docs/img/step1_reference.jpg" width="360" alt="reference frame"> <img src="docs/img/step2_depth.jpg" width="360" alt="the same frame as a depth map"></p>
29
+
30
+ You give that grey video to your video model as the reference and describe the people and the look in the prompt. The model takes the moves from the video and everything else from your words.
31
+
32
+ Technically: monocular video depth estimation. The model predicts relative inverse depth for every frame; ReShot normalises it once over the whole clip to 8-bit grey (near = white) and encodes it as a standard depth-map video.
33
+
34
+ ## How to use it
35
+
36
+ The three takes in the demo were made exactly this way. Every file involved is in this repo, so you can repeat it.
37
+
38
+ ### 1. Install
39
+
40
+ ```bash
41
+ pip install git+https://github.com/maosika-ai/reshot # needs ffmpeg on PATH
42
+ ```
43
+
44
+ No ffmpeg? `pip install "reshot[ffmpeg] @ git+https://github.com/maosika-ai/reshot"` bundles one. The model weights (111 MB) download on first run.
45
+
46
+ ### 2. Make the depth map
47
+
48
+ ```bash
49
+ reshot reference.mp4 -o depth.mp4 --target seedance
50
+ ```
51
+
52
+ `--target seedance` sets 24 fps, H.264, a frame size that is a multiple of 16 and at least 407,696 pixels, up to 15 seconds — the reference-video rules of the Seedance API. For MiniMax H3 use `--target h3` (multiples of 32). On an RTX 4090 a 12-second clip takes about 20 seconds; on a MacBook a few minutes. A whole folder at once, one model load: `reshot clips/*.mp4 -o depth/ --target seedance`.
53
+
54
+ ### 3. Give it to the video model
55
+
56
+ **Seedance 2.0 / 2.5.** Upload `depth.mp4` as a reference video. In the prompt, point at it and describe the people and the look:
57
+
58
+ ```
59
+ 参考@视频1的动作与运镜,顺序与视频保持一致。
60
+ 一名穿深绿色丝绒旗袍的女子在狭窄的金属走廊里与三名黑衣守卫搏斗,冷蓝走廊光,红色警示灯,电影感。
61
+ ```
62
+
63
+ **ComfyUI.** Install [ComfyUI-ReShot](https://github.com/maosika-ai/ComfyUI-ReShot) and drop the *ReShot Depth Video* node between Load Video and your model — no command line at all.
64
+
65
+ **MiniMax H3.** Attach `depth.mp4` as `<Video 1>`. If you want a specific face, attach a character sheet as `<Picture 1>`. These are the three sheets used for the demo:
66
+
67
+ <p align="center"><img src="docs/img/step3_sheets.jpg" width="720" alt="the three character sheets used as Picture 1"></p>
68
+
69
+ MiniMax H3 wants its prompt in a fixed six-section format. The full prompts for all three takes are in [`docs/prompts/`](docs/prompts/). The part that does the work is how `<Video 1>` is defined and what it is allowed to transfer:
70
+
71
+ ```
72
+ <Subject 3> is the fight choreography and camera movement shown in <Video 1>, a grey depth map
73
+ in which near objects are white and far objects are black: one fighter leans on a corridor wall
74
+ in close-up, kicks off it to tear down a pipe, fights several opponents, is grabbed from behind
75
+ by the largest and throws him, slams the last one into a wall panel, wipes the mouth in close-up,
76
+ then walks away through a door past the fallen opponents.
77
+
78
+ <Subject 3>: attribute_transfer - every action, position, timing and camera move of <Video 1>
79
+ is transferred onto <Subject 1> and <Subject 2>; its grey depth look is not transferred.
80
+ ```
81
+
82
+ Two things in there matter. **Say in words what happens in the grey clip** — the model reads the depth map far better when the prompt tells it what the blobs are doing. **Say that the grey look is not to be copied**, or you may get a grey film back.
83
+
84
+ ### 4. What comes out
85
+
86
+ <p align="center"><img src="docs/img/step4_takes.jpg" width="720" alt="the three takes"></p>
87
+
88
+ Left to right: [Jiang Xue](docs/prompts/take1_jiangxue_armor.txt) in bronze armour, [Su Wan](docs/prompts/take2_suwan_qipao.txt) in a green velvet qipao, and a [rabbit boxer](docs/prompts/take3_rabbit_boxer.txt) against a wolf, a tiger and a bear as a 3D animated feature. Same six shots, same close-up at the start, same walk out through the door at the end. The reference clip itself was a Seedance 2.0 text-to-video render (864×496, 12 s) and the takes were made on MiniMax H3, so nobody's likeness was involved at any step.
89
+
90
+ ## What transfers, and what doesn't
91
+
92
+ **Transfers:** who stands where, how big they are relative to each other, every move and its timing, the cuts, and the camera — push-ins, tracking, handheld shake.
93
+
94
+ **Doesn't:** faces (use a character sheet), clothes, lighting, colour, props in detail, and anything smaller than a hand. Those come from your prompt and your reference images.
95
+
96
+ Things we learned making the demo:
97
+
98
+ - **Keep the reference under 15 seconds** (Seedance's limit) and cut it to the shots you want before running ReShot. Everything in the clip gets copied, including the boring part at the end.
99
+ - **For MiniMax H3, make the depth map small: `--target h3 --max-res 320`** (that is 320×176 for a 16:9 clip). A full-size grey silhouette starts to pull the character's face shape towards the person in the reference; a small one carries the moves without the shape.
100
+ - **Change the species, keep the size ratio.** The bear take works because the prompt says the bear is "about 1.3× the rabbit, never more than 1.5×". The depth map already says who is bigger; the prompt must not contradict it.
101
+ - **Plain clothes on extras, no logos.** Whatever the prompt leaves open, the model fills with text and badges.
102
+
103
+ ## What you need
104
+
105
+ | | Runs? | Measured |
106
+ |---|---|---|
107
+ | **NVIDIA, 8 GB or more** (RTX 3070, 4060, 4090 …) | Yes | default `--quality fast`: 3 GB VRAM, 34 ms/frame on a 3080 Ti |
108
+ | **NVIDIA, 12 GB or more** | Yes, and `--quality full` fits too | full: 11 GB VRAM, 83 ms/frame on a 3080 Ti, 62 ms/frame on a 4090 |
109
+ | **Apple Silicon** | Yes, slower | M2 Max: ~500 ms/frame, a 12 s clip in about 2.5 min |
110
+ | **CPU only** | Yes, slow | ~1.8 s/frame |
111
+ | **Host RAM** | 16 GB covers clips up to ~27 s at 720p | peak = 2 GB + 224 MB per second of 720p; the tool refuses before starting if a clip won't fit |
112
+
113
+ **`--quality` — the resolution the model works at.** The output video is always the size of your source; this sets the size of the picture the depth model looks at.
114
+
115
+ | `--quality` | model sees (16:9 · 9:16 · 4:3) | VRAM | speed | detail |
116
+ |---|---|---|---|---|
117
+ | `fast` (default) | 644×364 · 364×644 · 490×364 | ~3 GB | 34 ms/frame on a 3080 Ti | large shapes identical to full; a loose strand of hair merges into the cheek |
118
+ | `full` | 924×518 · 518×924 · 686×518 | ~11 GB | 83 ms/frame on a 3080 Ti | sharper fine silhouettes |
119
+
120
+ We recommend `fast`: for copying blocking and camera it is all a video model needs — the demo takes were made from a depth map shrunk to 320×176 before it even reached MiniMax H3, far below either setting. Measured full against fast on the same 294-frame clip: mean difference 5.3 of 255 grey levels, 95 % of pixels within 15, edge energy −4.5 %. Use `full` for close-ups where thin silhouettes matter and you have the VRAM. The run prints the exact resolution it uses (`model fast: the model sees 644x364`) and records it in `--metrics`. Experts can set any short side with `--input-size`.
121
+
122
+ Verified on rented cards on 2026-09-12; the numbers are in the `--metrics` output of those runs.
123
+
124
+ ## Presets
125
+
126
+ | `--target` | fps | frame size | length | for |
127
+ |---|---|---|---|---|
128
+ | `seedance` | 24 | ×16, ≥ 407,696 px | ≤ 15 s | Seedance 2.0 / 2.5 reference video |
129
+ | `h3` | 24 | ×32 | ≤ 15 s | MiniMax H3 (reference video or Fun ControlNet depth) |
130
+ | `wan` | 16 | ×16 | – | Wan 2.1 VACE |
131
+ | `none` | source | even | – | anything that reads a depth video |
132
+
133
+ `reshot --help` lists every option; the [user guide](docs/USAGE.md) explains them.
134
+
135
+ ## For developers
136
+
137
+ ```python
138
+ from pathlib import Path
139
+ from reshot import RunConfig, run
140
+
141
+ run(RunConfig(input=Path("reference.mp4"), output=Path("depth.mp4"), target="seedance"))
142
+ ```
143
+
144
+ Three details make the output something a video model will actually follow:
145
+
146
+ - **One scale for the whole clip.** Depth is normalised once over all frames, never per frame, so a wall keeps the same grey when someone walks past it. Per-frame normalisation makes the scene "breathe".
147
+ - **Frames picked by timestamp.** 30 fps → 24 fps really is 24; nothing is duplicated or dropped in a pattern the model could learn.
148
+ - **Cropped, never padded.** Frame size is trimmed to the model's grid. A black border would read as a far wall.
149
+
150
+ The model is Video Depth Anything Small (ByteDance, CVPR 2025). It works on overlapping 32-frame windows and aligns them, so depth doesn't jitter between frames. A 12-second 720p clip peaks at 3.9 GB of host RAM and 11 GB of VRAM (3 GB with `--input-size 364`) (measured; the estimate the tool shows before starting is a fitted line, within 0.05 GB of measurements) and it refuses up front if a clip won't fit. A `fake` backend runs the whole pipeline without a model for your own tests. Errors that are yours to fix are `ReshotError` subclasses with an exit code and a concrete fix in the message.
151
+
152
+ ## License
153
+
154
+ Apache-2.0, and so is the default model. The vendored model code is under `reshot/third_party/`. Use it in a product, a pipeline, a service. The larger research-only weights (Base, Large) are CC-BY-NC and never load unless you ask for them.
155
+
156
+ Issues and pull requests are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md).
157
+
158
+ ## About Maosika 猫斯卡
159
+
160
+ ReShot is open-sourced by **[Maosika 猫斯卡](https://www.maosika.com)** (www.maosika.com), a
161
+ professional **AI video production system for short drama and short video**. Maosika takes a
162
+ story from a one-line idea to a finished vertical AI short drama: it writes the episodic
163
+ script, designs the characters and scenes, generates consistent character sheets and scene
164
+ images, and renders every shot with video models such as **Seedance 2.0 / 2.5** and
165
+ **MiniMax H3** — a crew of digital specialists handling each step, so one person can
166
+ produce a series that used to take a studio. Individual screenwriters, MCNs and short-drama
167
+ companies use Maosika to produce AI short drama every day.
168
+
169
+ ReShot is the depth-map step of that pipeline, released under Apache-2.0 so anyone
170
+ can copy a reference shot's staging and camera into their own AI-generated video. To make
171
+ AI short drama, AI short video or AI manhua drama end to end, visit
172
+ **[https://www.maosika.com](https://www.maosika.com)**.
173
+
174
+ <p align="center"><sub>Made by <a href="https://www.maosika.com">Maosika 猫斯卡</a> · AI short drama, produced daily · <a href="https://www.maosika.com">www.maosika.com</a></sub></p>
@@ -0,0 +1,22 @@
1
+ # ReShot
2
+
3
+ **Copy the shot, not the actors.**
4
+
5
+ ReShot turns a reference video into a depth-map video (near = white, far = black), so Seedance, MiniMax H3 or Wan can repeat its choreography and camera moves with your own characters.
6
+
7
+ ```bash
8
+ pip install reshot
9
+ reshot reference.mp4 -o depth.mp4 --target seedance
10
+ ```
11
+
12
+ - Presets for **Seedance 2.0 / 2.5** reference video (`--target seedance`), **MiniMax H3** (`h3`), **Wan 2.1 VACE** (`wan`).
13
+ - `--quality fast` (default; the model sees 644×364 for 16:9, ~3 GB VRAM) or `full` (924×518, ~11 GB).
14
+ - Depth normalised once over the whole clip — no flicker; frames picked by timestamp; sizes cropped to the model's grid, never padded.
15
+ - Batch a folder in one model load: `reshot clips/*.mp4 -o depth/`.
16
+ - Python API: `from reshot import RunConfig, run`.
17
+ - Apache-2.0, including the default model (Video Depth Anything Small).
18
+ - ComfyUI nodes: https://github.com/maosika-ai/ComfyUI-ReShot
19
+
20
+ Full guide, demo, measured performance and the prompts that made the demo takes: **https://github.com/maosika-ai/reshot**
21
+
22
+ Open-sourced by [Maosika 猫斯卡](https://www.maosika.com), the AI short-drama production system — from a one-line idea to episodic script, character sheets, scene images and every shot rendered with Seedance and MiniMax H3. https://www.maosika.com
@@ -0,0 +1,66 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "reshot"
7
+ dynamic = ["version"]
8
+ description = "ReShot — copy the shot, not the actors. Video → depth map for Seedance 2.0/2.5 reference video, MiniMax H3 Fun ControlNet and Wan VACE. Open-sourced by Maosika 猫斯卡 (www.maosika.com), the AI short-drama production system."
9
+ readme = "docs/PYPI.md"
10
+ license = { text = "Apache-2.0" }
11
+ requires-python = ">=3.10"
12
+ authors = [{ name = "Maosika 猫斯卡" }]
13
+ keywords = ["video", "depth", "controlnet", "video-generation", "depth-map", "depth-anything", "seedance", "minimax-h3", "ai-short-drama", "maosika"]
14
+ classifiers = [
15
+ "License :: OSI Approved :: Apache Software License",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Topic :: Multimedia :: Video",
21
+ "Topic :: Multimedia :: Graphics",
22
+ "Intended Audience :: End Users/Desktop",
23
+ "Operating System :: OS Independent",
24
+ ]
25
+ dependencies = [
26
+ "torch>=2.1",
27
+ "torchvision>=0.16",
28
+ "numpy>=1.24",
29
+ "opencv-python-headless>=4.8",
30
+ "einops>=0.4",
31
+ "easydict",
32
+ "tqdm",
33
+ "huggingface_hub>=0.20",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ ffmpeg = ["imageio-ffmpeg>=0.4.7"] # bundled ffmpeg if none on PATH
38
+ dev = ["pytest>=8", "ruff"]
39
+
40
+ [project.scripts]
41
+ reshot = "reshot.cli:main"
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/maosika-ai/reshot"
45
+ Documentation = "https://github.com/maosika-ai/reshot/blob/main/docs/USAGE.md"
46
+ "ComfyUI nodes" = "https://github.com/maosika-ai/ComfyUI-ReShot"
47
+ Changelog = "https://github.com/maosika-ai/reshot/blob/main/CHANGELOG.md"
48
+ Maosika = "https://www.maosika.com"
49
+
50
+ [tool.setuptools.dynamic]
51
+ version = { attr = "reshot._version.__version__" }
52
+
53
+ [tool.setuptools.packages.find]
54
+ include = ["reshot*"]
55
+
56
+ [tool.setuptools.package-data]
57
+ "reshot.third_party.video_depth_anything" = ["LICENSE"]
58
+ "reshot" = ["py.typed"]
59
+
60
+ [tool.ruff]
61
+ line-length = 120
62
+ extend-exclude = ["reshot/third_party"]
63
+
64
+ [tool.ruff.lint]
65
+ select = ["E", "F", "W", "I", "UP", "B", "SIM", "N", "RUF"]
66
+ ignore = ["E501", "RUF001", "RUF002", "RUF003"] # E501: formatter; RUF00x: unicode ×→ in comments is intentional
@@ -0,0 +1,58 @@
1
+ """ReShot — turn any video into a depth-map video for video-generation control.
2
+
3
+ from pathlib import Path
4
+ from reshot import RunConfig, run
5
+ run(RunConfig(input=Path("in.mp4"), output=Path("out.mp4"), target="h3"))
6
+
7
+ from reshot import extract, to_gray, write_gray_video
8
+ depths, fps = extract("in.mp4") # float32 [T, H, W], larger = closer
9
+ write_gray_video(to_gray(depths), "out.mp4", fps)
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ import os
15
+
16
+ # Apple Silicon: cap the MPS allocator at 60 % of the recommended working set. Unified
17
+ # memory means GPU allocations count against the same RAM as everything else; without a
18
+ # cap a long clip grows until the OS kills processes (seen 2026-09-11). Must be set
19
+ # before torch is imported, which is why it lives here.
20
+ os.environ.setdefault("PYTORCH_MPS_HIGH_WATERMARK_RATIO", "0.6")
21
+
22
+ from ._version import __version__
23
+ from .config import RunConfig
24
+ from .errors import BackendError, InputError, RamBudgetError, ReshotError, ToolMissingError
25
+ from .io import probe_video, read_video, write_gray_video
26
+ from .pipeline import Plan, RunResult, extract, model_input_resolution, plan, resolve_input_size, run, run_many
27
+ from .planning import memory_verdict, processing_max_res
28
+ from .postprocess import to_gray, upsample_frames
29
+ from .targets import TARGETS, Target, center_crop, fit_dimensions
30
+
31
+ __all__ = [
32
+ "TARGETS",
33
+ "BackendError",
34
+ "InputError",
35
+ "Plan",
36
+ "RamBudgetError",
37
+ "ReshotError",
38
+ "RunConfig",
39
+ "RunResult",
40
+ "Target",
41
+ "ToolMissingError",
42
+ "__version__",
43
+ "center_crop",
44
+ "extract",
45
+ "fit_dimensions",
46
+ "memory_verdict",
47
+ "model_input_resolution",
48
+ "plan",
49
+ "probe_video",
50
+ "processing_max_res",
51
+ "read_video",
52
+ "resolve_input_size",
53
+ "run",
54
+ "run_many",
55
+ "to_gray",
56
+ "upsample_frames",
57
+ "write_gray_video",
58
+ ]
@@ -0,0 +1 @@
1
+ __version__ = "0.3.7"
@@ -0,0 +1,23 @@
1
+ """Backend registry. `get_backend("vda", model="small", device="auto")`."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any
6
+
7
+ from .base import BackendInfo, DepthBackend
8
+ from .fake import FakeBackend
9
+ from .vda import VDABackend, pick_device
10
+
11
+
12
+ def get_backend(name: str, **kwargs: Any) -> DepthBackend:
13
+ """Instantiate a backend by name. Unknown names raise `BackendError`."""
14
+ from ..errors import BackendError
15
+
16
+ if name == "vda":
17
+ return VDABackend(**kwargs)
18
+ if name == "fake":
19
+ return FakeBackend()
20
+ raise BackendError(f"unknown backend {name!r}")
21
+
22
+
23
+ __all__ = ["BackendInfo", "DepthBackend", "FakeBackend", "VDABackend", "get_backend", "pick_device"]