feat: Implement weight cutout boundary smoothing for image depth cutout

- Added a new proposal for boundary smoothing in the weight cutout process, differentiating between Split edges and Outline smoothing requirements.
- Introduced a new capability `cutout-boundary-smoothing` to control smoothing strength and default values.
- Updated specifications to define the behavior of boundary-specific smoothing strength and default settings.
- Created tasks to verify the implementation of boundary behavior and asset updates.
- Developed comprehensive tests for depth symmetry and normal scaling to ensure expected behavior and performance.
- Introduced new attributes for normal mapping to facilitate persistent face attributes sharing between depth symmetry and image materials.
- Built a new node group for O Image Depth Symmetry, integrating the new smoothing capabilities and ensuring compatibility with existing workflows.
This commit is contained in:
2026-09-14 12:44:20 +08:00
parent 09778c4b48
commit dc000e50b1
53 changed files with 1350 additions and 364 deletions

View File

@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-09-14

View File

@@ -0,0 +1,29 @@
## Context
Depth Cutout 当前在 Split 后对全部实际边界使用同一两圈 influence 和同一 `Smooth Weight`。原始 Outline 需要保形,Split 形成的切边则需要更强平滑;两者可通过分裂前原始几何的轮廓字段区分。
## Goals / Non-Goals
**Goals:**
- 只保留一个 `Boundary Smooth` 次数输入。
- Split 边使用完整强度,Outline 使用固定 `0.1` 倍强度。
- 两类影响带相交时保留更强的 Split 平滑。
**Non-Goals:**
- 不增加独立的 Outline 或 Split 平滑参数。
- 不改变影响带宽度、整体 `Smooth Weight` 或普通 `Smooth` 的语义。
## Decisions
在 Split 前保留原始几何引用,并在当前投影几何上通过 `original_boundary_field()` 识别原始 Outline。分别构造 Outline 与 Split 边界字段及其两圈 influence:当前实际边界扣除 Outline 后作为 Split 边,Outline influence 乘 `0.1`,最终使用两者最大值。
两类边界继续进入同一个 Repeat Zone,共用 `Boundary Smooth` 次数和 `Smooth Weight`。相比串联两套平滑循环,这样不会增加公开参数,并保持节点数量与求值成本较低。交汇区域取最大值,使 Split 的完整强度优先。
`Boundary Smooth` 默认值改为 `4`,范围及零值旁路保持不变。
## Risks / Trade-offs
- Outline 每轮权重为 `0.1`,多次迭代后的累计位移不等于最终位移的 10% → 以行为测试验证它始终弱于相同设置下的 Split,并由默认 4 次控制累计程度。
- Split influence 向 Outline 邻域扩散时会在交点附近覆盖弱 Outline influence → 这是 Split 优先规则的预期结果,测试交汇区域输出有限且拓扑不变。

View File

@@ -0,0 +1,23 @@
## Why
`O Image Depth Cutout` 的 Split 边与原始 Outline 对几何平滑的需求不同:Split 边需要完整强度消除切缝折痕,而 Outline 只需轻微整理,避免轮廓被过度软化。
## What Changes
- `Boundary Smooth` 继续作为唯一的边界平滑次数控制,默认值改为 `4`。
- Split 边使用完整 `Smooth Weight`,Outline 使用其 `0.1` 倍;两类影响相交时由 Split 强度优先。
- 保持 `Boundary Smooth = 0` 完全关闭边界平滑。
## Capabilities
### New Capabilities
- `cutout-boundary-smoothing`: 定义 Depth Cutout 对 Split 边与 Outline 的差异化平滑强度和默认控制值。
### Modified Capabilities
无。
## Impact
影响 `tools/nodes/common/boundary_smoothing.py`、`tools/nodes/groups/image_depth_cutout.py`、相关节点测试和 `src/anyimage/assets/O_AnyImage.blend`;不增加或移除公开输入。

View File

@@ -0,0 +1,30 @@
## ADDED Requirements
### Requirement: Boundary-specific smoothing strength
`O Image Depth Cutout` SHALL 使用单个 `Boundary Smooth` 输入控制边界平滑次数。Split 边 SHALL 使用完整 `Smooth Weight`,原始 Outline SHALL 使用 `0.1` 倍 `Smooth Weight`;两类影响相交时 Split 强度 MUST 优先。
#### Scenario: Separate Split and Outline response
- **WHEN** 同一网格同时存在 Split 边与原始 Outline 且启用 Boundary Smooth
- **THEN** Split 边按完整 Smooth Weight 平滑
- **AND** 仅受 Outline 影响的点按其 0.1 倍平滑
#### Scenario: Split and Outline intersection
- **WHEN** Split 与 Outline 的两圈影响范围相交
- **THEN** 相交区域使用两者中较强的 Split influence
### Requirement: Boundary Smooth default and bypass
`O Image Depth Cutout` 的 `Boundary Smooth` SHALL 默认为 `4`,保持范围 `0–16`;值为 `0` 时 MUST 完全旁路边界平滑。
#### Scenario: New node group defaults
- **WHEN** 构建新的 O Image Depth Cutout 节点组
- **THEN** Boundary Smooth 默认值为 4
#### Scenario: Disabled boundary smoothing
- **WHEN** Boundary Smooth 为 0
- **THEN** Split 边和 Outline 均不发生边界平滑位移

View File

@@ -0,0 +1,9 @@
## 1. Boundary behavior
- [x] 1.1 区分 Depth Cutout 的 Split 与 Outline influence,并在单一平滑循环中应用完整与 0.1 倍权重。
- [x] 1.2 将 O Image Depth Cutout 的 Boundary Smooth 默认值改为 4,保持零值旁路和既有范围。
## 2. Verification and asset
- [x] 2.1 更新相关行为与接口测试,覆盖 Split 优先、Outline 弱权重、默认值和关闭行为。
- [x] 2.2 运行相关测试,执行 `uv run node-group build` 并确认保存资产验证通过。