f686b338d6
- docs/capabilities/comfyui.md - python/functions/ml/comfyui_build_image_to_3d_workflow.md - python/functions/ml/comfyui_build_image_to_3d_workflow.py - python/functions/ml/tests/test_comfyui_build_image_to_3d_workflow.py - python/functions/ml/comfyui_build_facedetailer_workflow.md - python/functions/ml/comfyui_build_facedetailer_workflow.py - python/functions/ml/comfyui_build_hires_fix_workflow.md - python/functions/ml/comfyui_build_hires_fix_workflow.py - python/functions/ml/tests/test_comfyui_build_facedetailer_workflow.py - python/functions/ml/tests/test_comfyui_build_hires_fix_workflow.py - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4.5 KiB
4.5 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| comfyui_mesh_cleanup_oneshot | pipeline | py | pipelines | 1.0.0 | impure | def comfyui_mesh_cleanup_oneshot(in_path: str, *, target_faces: int = 80000, watertight: bool = True, method: str = "repair", out_path: str | None = None) -> dict | Pipeline de limpieza de mallas 3D en una sola llamada: decima a un presupuesto de caras (comfyui_simplify_mesh) y, opcionalmente, la hace estanca (comfyui_make_watertight). Capitaliza el 'Golden 3' del report 0088 (80k caras + estanca a la vez) para las mallas densas no estancas que produce el pipeline Hunyuan3D de ComfyUI. Promocion de secuencia (issue 0087). Impuro: lee y escribe archivos en disco; requiere trimesh + pymeshlab + scipy. |
|
|
false | error_py_core |
|
|
dict {ok, in_path, out_path, in_faces, simplified_faces, final_faces, watertight_requested, is_watertight, method, steps, error}. steps = resultados crudos de cada funcion compuesta. Si algun paso falla, ok=False y error explica en cual. | false | python/functions/pipelines/comfyui_mesh_cleanup_oneshot.py |
Ejemplo
# Limpia la malla densa de ComfyUI: decima a 80k caras y la hace estanca.
./fn run comfyui_mesh_cleanup_oneshot ~/ComfyUI/output/3d_mesh_00002_.glb
import sys, os
sys.path.insert(0, os.path.join(os.environ["HOME"], "fn_registry", "python", "functions"))
from pipelines.comfyui_mesh_cleanup_oneshot import comfyui_mesh_cleanup_oneshot
res = comfyui_mesh_cleanup_oneshot(
os.path.expanduser("~/ComfyUI/output/3d_mesh_00002_.glb"),
target_faces=80000,
watertight=True,
)
# res["ok"] == True
# res["in_faces"] >> res["final_faces"] # decimada
# res["is_watertight"] # True/False segun method y la malla
print(res["in_faces"], "->", res["final_faces"], "watertight:", res["is_watertight"])
Cuando usarla
Justo después de generar una malla 3D con ComfyUI/Hunyuan3D
(comfyui_image_to_3d_oneshot, comfyui_text_to_3d_oneshot), cuando el GLB sale
denso (decenas de MB, >1M caras) y/o no estanco. En una llamada la dejas lista
para web (ligera) o impresión 3D (cerrada). Es la promoción del patrón
"simplify → make_watertight" que se repetía a mano (reports 0088/0091).
Gotchas
- Impuro: lee y escribe archivos en disco. Con
watertight=Truedeja también un intermedio<out>_simplified.glbjunto al final. - Necesita
trimesh+pymeshlab+scipy(decimación). Conmethod="voxel"ademásscikit-image(marching cubes). Si falta una, el paso correspondiente devuelveok=Falsecon el comandouv adda ejecutar. method="repair"(default) NO garantiza estanqueidad en mallas muy rotas: cierra huecos pequeños y conserva las caras decimadas. El output reportais_watertightreal — compruébalo. Si necesitas estanqueidad GARANTIZADA usamethod="voxel"(re-malla: cambia el conteo de caras y descarta UV/colores).- El
target_facesaplica al paso de decimación. Conmethod="voxel"el conteo final lo fija el voxel-remesh (mirafinal_faces), notarget_faces. - El pipeline NO falla si la malla no queda estanca con
repair: devuelveok=Trueconis_watertight=False. Decide en el caller si reintentar conmethod="voxel". - No toca el servidor ComfyUI: opera sobre archivos GLB ya en disco.
Capability growth log
- v1.0.0 (2026-06-24) — pipeline inicial. Compone
comfyui_simplify_mesh+comfyui_make_watertight(issue 0087, capitaliza report 0088).