Commit ·
ee68aaa
1
Parent(s): 1541ab3
refactor: round 6 — drop unused list-wrapper public APIs
Browse filespipeline/lama.py
- Delete inpaint_frames_lama (the list-materialising wrapper around
inpaint_frames_lama_stream). Never called anywhere; only the
streaming generator is used end-to-end.
pipeline/vace.py
- Delete inpaint_frames_vace for the same reason — the streaming
inpaint_frames_vace_stream is the only consumer path.
Reduces public API surface area; the streaming functions are now the
sole supported entry points for both modes, matching how each is
actually integrated with composite_and_save.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- pipeline/lama.py +0 -33
- pipeline/vace.py +0 -23
pipeline/lama.py
CHANGED
|
@@ -15,7 +15,6 @@ Pipeline for each frame:
|
|
| 15 |
Public API
|
| 16 |
----------
|
| 17 |
- inpaint_frames_lama_stream — generator: one crop at a time (memory-efficient)
|
| 18 |
-
- inpaint_frames_lama — list version (convenience wrapper around the above)
|
| 19 |
|
| 20 |
License: LaMa is Apache 2.0.
|
| 21 |
"""
|
|
@@ -126,38 +125,6 @@ def inpaint_frames_lama_stream(
|
|
| 126 |
yield np.array(inpainted_pil.convert("RGB"))
|
| 127 |
|
| 128 |
|
| 129 |
-
def inpaint_frames_lama(
|
| 130 |
-
frame_paths: List[Path],
|
| 131 |
-
crop_region: CropRegion,
|
| 132 |
-
inpaint_mask: np.ndarray,
|
| 133 |
-
progress_fn=None,
|
| 134 |
-
) -> List[np.ndarray]:
|
| 135 |
-
"""
|
| 136 |
-
Run LaMa inpainting on all frames and return a list of inpainted crops.
|
| 137 |
-
|
| 138 |
-
Convenience wrapper around :func:`inpaint_frames_lama_stream` that
|
| 139 |
-
materialises the full list. Prefer the streaming version when compositing
|
| 140 |
-
immediately to avoid holding all crops in RAM simultaneously.
|
| 141 |
-
|
| 142 |
-
Parameters
|
| 143 |
-
----------
|
| 144 |
-
frame_paths : List[Path]
|
| 145 |
-
crop_region : CropRegion
|
| 146 |
-
inpaint_mask : np.ndarray
|
| 147 |
-
Crop-local binary mask (H × W, uint8). 255 = inpaint, 0 = keep.
|
| 148 |
-
progress_fn : callable, optional
|
| 149 |
-
Called as ``progress_fn(i)`` after each frame.
|
| 150 |
-
|
| 151 |
-
Returns
|
| 152 |
-
-------
|
| 153 |
-
List[np.ndarray]
|
| 154 |
-
Inpainted crop images (crop_h × crop_w × 3, uint8 RGB), one per frame.
|
| 155 |
-
"""
|
| 156 |
-
return list(
|
| 157 |
-
inpaint_frames_lama_stream(frame_paths, crop_region, inpaint_mask, progress_fn)
|
| 158 |
-
)
|
| 159 |
-
|
| 160 |
-
|
| 161 |
# ---------------------------------------------------------------------------
|
| 162 |
# Private helpers
|
| 163 |
# ---------------------------------------------------------------------------
|
|
|
|
| 15 |
Public API
|
| 16 |
----------
|
| 17 |
- inpaint_frames_lama_stream — generator: one crop at a time (memory-efficient)
|
|
|
|
| 18 |
|
| 19 |
License: LaMa is Apache 2.0.
|
| 20 |
"""
|
|
|
|
| 125 |
yield np.array(inpainted_pil.convert("RGB"))
|
| 126 |
|
| 127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
# ---------------------------------------------------------------------------
|
| 129 |
# Private helpers
|
| 130 |
# ---------------------------------------------------------------------------
|
pipeline/vace.py
CHANGED
|
@@ -411,26 +411,3 @@ def inpaint_frames_vace_stream(
|
|
| 411 |
torch.cuda.empty_cache()
|
| 412 |
|
| 413 |
|
| 414 |
-
def inpaint_frames_vace(
|
| 415 |
-
frame_paths: List[Path],
|
| 416 |
-
crop_region: CropRegion,
|
| 417 |
-
inpaint_mask: np.ndarray,
|
| 418 |
-
num_inference_steps: Optional[int] = None,
|
| 419 |
-
guidance_scale: Optional[float] = None,
|
| 420 |
-
progress_fn: Optional[Callable[[int, int], None]] = None,
|
| 421 |
-
) -> List[np.ndarray]:
|
| 422 |
-
"""
|
| 423 |
-
Materialise the streaming version into a list. Convenience wrapper —
|
| 424 |
-
prefer :func:`inpaint_frames_vace_stream` when compositing immediately
|
| 425 |
-
to avoid holding all crops in RAM simultaneously.
|
| 426 |
-
"""
|
| 427 |
-
return list(
|
| 428 |
-
inpaint_frames_vace_stream(
|
| 429 |
-
frame_paths,
|
| 430 |
-
crop_region,
|
| 431 |
-
inpaint_mask,
|
| 432 |
-
num_inference_steps=num_inference_steps,
|
| 433 |
-
guidance_scale=guidance_scale,
|
| 434 |
-
progress_fn=progress_fn,
|
| 435 |
-
)
|
| 436 |
-
)
|
|
|
|
| 411 |
torch.cuda.empty_cache()
|
| 412 |
|
| 413 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|