Files
AnyImage/README.md
nan 8aac4822c6 feat: Implement background depth distance feature for depth processing
- Added `background_depth_distance` property to `ActiveJob` and `RunJob` classes to manage background depth settings.
- Updated job execution to handle background depth distance, allowing for fixed negative displacement in depth calculations.
- Introduced new functions in the worker module to apply background depth distance to depth frames and manage original background depth.
- Enhanced tests to cover new functionality, ensuring correct behavior of background depth processing and reference depth extraction.
- Refactored job submission to run in a separate thread, improving responsiveness during execution.
2026-08-09 16:34:41 +08:00

2.9 KiB
Raw Blame History

SnapForm

SnapForm 是一个 Blender 扩展,可以把一张照片、一段视频或一组序列帧快速变成有真实深度的立体面片。

它能做什么

  • 一键把 Image Empty 转换为立体面片:让 AI 估算深度,或直接用原图作为深度
  • 一键去除图片背景,生成透明前景图
  • 支持视频与序列帧输入,逐帧处理,动画也能得到逐帧对应的立体面片
  • 全部操作都在右键菜单里完成,不需要写任何代码

安装

  1. 下载对应系统的扩展压缩包
  2. 打开 Blender,进入 Preferences > Extensions
  3. 点击 Install from Disk,选择下载的压缩包
  4. 在扩展偏好设置中确认 Storage Root 与 Device(保持默认即可);Device 默认取本机 最快的 CUDA/MPS,否则 CPU。下载超时会自动重试国内镜像,无需手动配置
  5. 打开 3D 视图右侧的 SnapForm 面板,点击 Install Runtime

DA3、BEN2 源码包和 uv 已内置在扩展里,安装时直接从本地解包,不需要访问 GitHub。首次使用仍会自动 下载运行环境依赖(PyTorch 等),随后自动下载 DA3 Small 和 BEN2 Base。其他 AI 模型可在 Host > Models 中按需下载,请保持网络畅通,首次安装需要一些时间。

快速上手

转换为立体面片

  1. 在 3D 视图中选中一个 Image Empty(空物体,显示方式为 Image)
  2. 右键选择 Convert to Depth Plane
  3. 在对话框中选择:
    • Depth from:Original 直接用原图,AI Generated 让 AI 估算深度
    • Background Depth Distance 为 0 时不剔除背景;大于 0 时把背景设为固定距离,AI 与 Original 均支持
    • 其余选项保持默认即可
  4. 点击确认,稍等片刻就得到带位移的立体面片

去除背景

选中 Image Empty 后,右键选择 Remove Background,完成后 Empty 会自动换成透明前景图。

视频与序列帧

SnapForm 支持视频(mp4、mkv、mov 等)和序列帧,会逐帧处理并生成逐帧对应的立体面片。处理范围默认 跟随 Empty 上设置的 Image Frames 与 Offset,不需要额外配置。

任务结果保存在哪里

任务结果保存在 ~/.snapform/jobs/ 下,每个任务一个文件夹。视频或序列帧生成的面片会引用这些文件夹 里的序列帧,请保留对应文件夹,不要随意删除。

常见问题

  • 首次使用需要下载模型,如果下载慢或失败,稍后在 Host > Models 里重试即可
  • 安装 Runtime 时提示下载超时:新版会自动探测并切换到镜像、失败时自动重试一次;如果仍然 超时,在扩展偏好设置的 PyPI Index 中填入镜像地址(如清华)后重新安装即可
  • 找不到右键入口时,请确认选中了 Empty,且显示方式为 Image
  • 动画面片不动:检查 Empty 的 Image Frames 是否大于 1,并确认播放场景帧

技术文档

面向开发者的技术内容见 docs/technical.md。