- Added interaction helpers for cutout region validation and shape menu interaction. - Created main operator for converting image regions into cutout shapes, including AI artifact generation. - Introduced object creation logic for cutout shapes, handling depth and normal textures. - Defined cutout shape identifiers and node groups for various shape types. - Implemented depth texture writing and prediction artifact generation for MoGe-2. - Developed server jobs for generating cutout artifacts, depth planes, and refining image regions. - Added region refinement logic to enhance gesture masks using BEN2.
1.7 KiB
1.7 KiB
Debug Operator
Debug Operator 从面板中的模型参数发起一次原始推理,把结果文件留在 Job 目录中供开发者检查,不创建用户场景对象。
执行过程
flowchart TD
Panel["Debug 面板"] --> Operator["选择模型 Debug Operator"]
Operator --> Request["读取 Scene 参数"]
Request --> Job["提交对应 Debug Job"]
Job --> Output["写出原始预测产物"]
Output --> Directory["打开 Job 目录"]
DA3、MoGe-2、BEN2 和 Upscale 都走这条调试路径。它验证模型、设备、请求参数和输出格式,但不代表正式功能的对象创建流程。
节点说明
从 Debug 面板进入
入口显示在 src/anyimage/panel.py,四个 Operator 定义在 operators/debug.py:DebugDa3、DebugMoge2、DebugBen2 和 DebugUpscale。它们读取 Scene.anyimage_settings 中的输入路径、设备、模型和分辨率参数,并检查 Environment 与模型是否可用。
提交原始推理
debug.py 分别提交 debug-da3、debug-moge2、debug-ben2 和 debug-upscale Job。Server 侧由 server/jobs/debug_predictions.py 接收请求,再调用相应模型适配器。
DA3 和 MoGe-2 的可视化与数组输出由 server/outputs/debug_da3.py、server/outputs/debug_moge2.py 写出;BEN2 与 Upscale 保留模型返回的图片结果。这里允许 DA3 继续存在,但它不会被 Plane、Depth Plane 或 Cutout 的正式 Operator 调用。
查看结果
任务完成后,debug.py 的 _open_job_directory() 调用 Blender 的路径打开操作,直接显示该 Job 的目录。响应阶段不导入 Image,不创建 Mesh、Material 或 Modifier,也不修改当前场景。