From e18d980b77c66d8e23d2d25a4702825fd104fc00 Mon Sep 17 00:00:00 2001 From: BennyKok Date: Sun, 20 Apr 2025 22:54:51 +0800 Subject: [PATCH] Benny/fix 3d upload (#85) * fix 3d upload with subfolder support and enhanced logging * Use parent folder name as subfolder for model file uploads --- custom_routes.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/custom_routes.py b/custom_routes.py index 37e30f0..5d63b71 100644 --- a/custom_routes.py +++ b/custom_routes.py @@ -1310,7 +1310,7 @@ send_json = prompt_server.send_json async def send_json_override(self, event, data, sid=None): - # logger.info("INTERNAL:", event, data, sid) + # logger.info(f"INTERNAL: event={event}, data={data}, sid={sid}") prompt_id = data.get("prompt_id") target_sid = sid @@ -2014,9 +2014,12 @@ async def upload_in_background( if file_type == "model_file": if isinstance(item, str): filename = os.path.basename(item) + # Extract folder name from the path + folder_path = os.path.dirname(item) + subfolder = os.path.basename(folder_path) if folder_path else "" item = { "filename": filename, - "subfolder": "", + "subfolder": subfolder, "type": "output", } @@ -2668,6 +2671,8 @@ class UploadQueue: node_id = upload_task["node_id"] upload_id = upload_task["upload_id"] + print(file_info) + try: # Coordinate the actual start of the upload async with self.upload_lock: