Files
AnyImage/README.md
nan 6d4d1c4ec2 Refactor and enhance DA3 and BEN2 debug panels, introduce mesh export functionality
- Renamed DA3 and BEN2 debug panels for clarity and consistency.
- Added a new function to draw DA3 input settings to reduce code duplication.
- Implemented mesh export functionality, including confidence thresholding and edge filtering.
- Updated export format options to include new mesh type and adjusted related properties.
- Enhanced job handling to move generated inputs into job root and manage temporary directories.
- Improved error handling and file management during export processes.
- Added unit tests for new mesh functionality and ensured existing tests cover changes.
2026-08-09 21:31:08 +08:00

64 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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/` 下,每个任务一个文件夹,名称统一为
`动作-对象_日期-时间-微秒`。Packed Image 和序列帧的输入副本会直接归档到对应任务根目录,
不再使用公共 `inputs/` 文件夹;导出产物也尽量平铺。视频或序列帧生成的面片会引用任务文件夹里的
序列帧,请保留对应文件夹,不要随意删除。
## 常见问题
- 首次使用需要下载模型,如果下载慢或失败,稍后在 `Host > Models` 里重试即可
- 安装 Runtime 时提示下载超时:新版会自动探测并切换到镜像、失败时自动重试一次;如果仍然
超时,在扩展偏好设置的 `PyPI Index` 中填入镜像地址(如清华)后重新安装即可
- 找不到右键入口时,请确认选中了 Empty,且显示方式为 Image
- 动画面片不动:检查 Empty 的 `Image Frames` 是否大于 1,并确认播放场景帧
## 技术文档
面向开发者的技术内容见 [docs/technical.md](docs/technical.md)。