Add tools and tests for AnyImage model management and documentation

- Implement sync_models.py for preparing and uploading ONNX artifacts.
- Create build_node.py for building and validating Blender scripts.
- Add docs.py for building and previewing documentation with Mike or MkDocs.
- Introduce model_exports.py for exporting PyTorch models to ONNX format.
- Develop pack.py for packaging the project with dependencies for different platforms.
- Add test_sync_models.py to validate sync_models functionality.
- Add test_tool_commands.py to ensure repository tools have correct command scripts.
- Initialize tools package with __init__.py.
This commit is contained in:
2026-08-31 15:15:33 +08:00
parent 377eee43f5
commit e7aeeb21d4
99 changed files with 1953 additions and 1676 deletions

View File

@@ -5,7 +5,7 @@ from dataclasses import dataclass
from ...preferences import addon_preferences
from ...server.media.resolution import limited_image_size
from ..common.image_data import image_empty_bounds
from ...common.image_data import image_empty_bounds
@dataclass(frozen=True)

View File

@@ -4,9 +4,10 @@ from ...preferences import (
MAX_CUTOUT_MESH_RESOLUTION,
MIN_CUTOUT_MESH_RESOLUTION,
)
from ..common.image_data import image_rgba
from ..common.image_region import rasterize_region_path
from ...common.image_data import image_rgba
from ...common.image_region import rasterize_region_path
from .geometry import CUTOUT_ALPHA_THRESHOLD
from .shape import CUTOUT_SHAPE_LABELS
def validate_cutout_region(
@@ -76,7 +77,7 @@ def open_shape_pie(
_pie_button(
pie,
"SURFACE",
"Surface",
CUTOUT_SHAPE_LABELS["SURFACE"],
"MESH_GRID",
source_name,
region_path_json,
@@ -87,7 +88,7 @@ def open_shape_pie(
_pie_button(
pie,
"BALLOON",
"Balloon",
CUTOUT_SHAPE_LABELS["BALLOON"],
"MESH_UVSPHERE",
source_name,
region_path_json,
@@ -98,7 +99,7 @@ def open_shape_pie(
_pie_button(
pie,
"DEPTH_BALLOON",
"Depth Balloon",
CUTOUT_SHAPE_LABELS["DEPTH_BALLOON"],
"META_BALL",
source_name,
region_path_json,
@@ -109,7 +110,7 @@ def open_shape_pie(
_pie_button(
pie,
"DEPTH_SURFACE",
"Depth Surface",
CUTOUT_SHAPE_LABELS["DEPTH_SURFACE"],
"SURFACE_NCURVE",
source_name,
region_path_json,

View File

@@ -22,7 +22,7 @@ from ...server.media.resolution import (
MAX_MAX_AI_INPUT_SIZE,
MIN_MAX_AI_INPUT_SIZE,
)
from ..common.ai_job import (
from ...common.ai_job import (
invoke_ai_setup_if_needed,
moge2_parameters,
production_device,
@@ -30,7 +30,7 @@ from ..common.ai_job import (
require_input_path,
require_model,
)
from ..common.image_data import (
from ...common.image_data import (
cleanup_image_input,
image_rgba,
load_normal_result_image,
@@ -39,8 +39,8 @@ from ..common.image_data import (
source_start_frame,
video_total_frames,
)
from ..common.depth_data import load_depth_metadata, load_depth_result_image
from ..common.image_interaction import (
from ...common.depth_data import load_depth_metadata, load_depth_result_image
from ...common.image_interaction import (
ImageRegionGesture,
apply_region_settings,
draw_region_settings,
@@ -49,7 +49,7 @@ from ..common.image_interaction import (
resolve_image_edit_click,
serialize_matrix,
)
from ..common.image_region import (
from ...common.image_region import (
ImageEditWarning,
RegionMask,
RegionPath,

View File

@@ -4,19 +4,19 @@ from enum import StrEnum
import bpy
from ..common.image_data import (
from ...common.image_data import (
color_data_name,
image_rgba,
)
from ..common.depth_data import camera_depth_values, depth_uniform_scale
from ..common.mesh_result import (
from ...common.depth_data import camera_depth_values, depth_uniform_scale
from ...common.object import (
IMAGE_MATERIAL_NODE_GROUP_NAME,
create_image_material,
finalize_object_result,
load_asset_node_group,
modifier_input_identifier,
set_modifier_input,
)
from ...common.node import load_node_group
from .geometry import (
DEFAULT_DEPTH_BASELINE,
DEFAULT_DEPTH_DIRECTION,
@@ -123,7 +123,7 @@ def _cropped_color_image(source_object, region_mask, source_rgba):
def load_cutout_node_group():
return load_asset_node_group(CUTOUT_NODE_GROUP_NAME)
return load_node_group(CUTOUT_NODE_GROUP_NAME)
def _connect_balloon_normal_scale(material):