From fb81ea5eec910cd8825a2aa247ca78237a4b9483 Mon Sep 17 00:00:00 2001 From: ussoewwin <136552381+ussoewwin@users.noreply.github.com> Date: Sun, 2 Nov 2025 05:26:11 +0900 Subject: [PATCH] docs: Add complete integration code block to be deleted in manual cleanup option --- README.md | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4722ac8..b87042c 100644 --- a/README.md +++ b/README.md @@ -139,22 +139,42 @@ If you prefer to manually edit files: 1. Open `ComfyUI/custom_nodes/ComfyUI-nunchaku/__init__.py` -2. Find the section with "ComfyUI-QwenImageLoraLoader Integration" marker +2. Find and delete the entire following block (it will be at the end of the file): -3. Delete the entire `try/except` block that contains: - ```python - try: - # ComfyUI-QwenImageLoraLoader Integration - ... (integration code) ... - except ImportError: - logger.exception("...") - ``` +```python +# BEGIN ComfyUI-QwenImageLoraLoader Integration +try: + # Import from the independent ComfyUI-QwenImageLoraLoader + import sys + import os + qwen_lora_path = os.path.join(os.path.dirname(__file__), "..", "ComfyUI-QwenImageLoraLoader") + if qwen_lora_path not in sys.path: + sys.path.insert(0, qwen_lora_path) + + # Import directly from the file path + import importlib.util + spec = importlib.util.spec_from_file_location("qwenimage", os.path.join(qwen_lora_path, "nodes", "lora", "qwenimage.py")) + qwenimage_module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(qwenimage_module) + + NunchakuQwenImageLoraLoader = qwenimage_module.NunchakuQwenImageLoraLoader + NunchakuQwenImageLoraStack = qwenimage_module.NunchakuQwenImageLoraStack + + NODE_CLASS_MAPPINGS["NunchakuQwenImageLoraLoader"] = NunchakuQwenImageLoraLoader + NODE_CLASS_MAPPINGS["NunchakuQwenImageLoraStack"] = NunchakuQwenImageLoraStack + logger.info("Successfully imported Qwen Image LoRA loaders from ComfyUI-QwenImageLoraLoader") +except ImportError: + logger.exception("Nodes `NunchakuQwenImageLoraLoader` and `NunchakuQwenImageLoraStack` import failed:") +# END ComfyUI-QwenImageLoraLoader Integration +``` + +3. Delete this entire block from the file 4. Save the file 5. Restart ComfyUI -**The integration code is marked with clear BEGIN/END markers, making it easy to identify and remove.** +**Important:** Look for the BEGIN and END markers. Delete everything from `# BEGIN ComfyUI-QwenImageLoraLoader Integration` to `# END ComfyUI-QwenImageLoraLoader Integration` (inclusive). ## Why the Integration Code is No Longer Needed