Load Mesh combo refreshes live; require comfy-env 0.4.3

Mark the file_path combo with comfy-env's dynamic-dir spec so its options are
re-scanned from input/3d (recursively) and the input root on each /object_info,
instead of returning the snapshot frozen at node-scan time. Newly uploaded
meshes now appear in the dropdown without a server restart.
This commit is contained in:
PozzettiAndrea
2026-06-19 13:17:50 +02:00
parent dbacb9c18d
commit 4e1f1cdb5b
2 changed files with 16 additions and 3 deletions
+15 -2
View File
@@ -39,14 +39,27 @@ class LoadMesh(io.ComfyNode):
@classmethod
def define_schema(cls):
mesh_files = cls.get_mesh_files()
placeholder = "No mesh files found in input/3d or input folders"
if not mesh_files:
mesh_files = ["No mesh files found in input/3d or input folders"]
mesh_files = [placeholder]
return io.Schema(
node_id="GeomPackLoadMesh",
display_name="Load Mesh",
category="geompack/io",
inputs=[
io.Combo.Input("file_path", options=mesh_files),
io.Combo.Input("file_path", options=mesh_files,
extra_dict={
# comfy-env: re-scan input/3d (recursively) and
# the input root live so newly uploaded meshes
# appear in the dropdown without a restart.
"comfy_env_dynamic_dir": "3d",
"comfy_env_sources": [
{"dir": "3d", "recursive": True, "rel_to_input": True},
{"dir": "", "recursive": False, "rel_to_input": False},
],
"comfy_env_exts": cls.SUPPORTED_EXTENSIONS,
"comfy_env_placeholder": placeholder,
}),
],
outputs=[
io.Custom("TRIMESH").Output(display_name="mesh"),
+1 -1
View File
@@ -1,3 +1,3 @@
comfy-env==0.4.1
comfy-env==0.4.3
comfy-3d-viewers==0.2.48
trimesh[easy]>=4.0.0