diff --git a/__init__.py b/__init__.py index 65c9e17..2a8866c 100644 --- a/__init__.py +++ b/__init__.py @@ -1,3 +1,15 @@ +print("\n\033[32mInitializing ControlAltAI Nodes\033[0m") # Fixed green reset +try: + import xformers + print("\n\033[94mControlAltAI: xformers found!\033[0m") # Light blue +except ImportError: + print("\n" + "="*70) + print("\033[94mCONTROLALTAI-NODES: XFORMERS REQUIRED\033[0m") # Light blue + print("\033[33mSome nodes in this custom node pack require xformers to function properly.") # Start orange + print("\nPlease check \"import_error_solution.txt\" in ComfyUI\\custom_nodes\\ControlAltAI-Nodes for how to install XFormers\033[0m") # End orange + print("="*70 + "\n") + raise ImportError("xformers is required for ControlAltAI Nodes") + from .flux_resolution_cal_node import FluxResolutionNode from .flux_sampler_node import FluxSampler from .flux_union_controlnet_node import FluxUnionControlNetApply @@ -15,8 +27,6 @@ from .flux_attention_control_node import FluxAttentionControl from .region_overlay_visualizer_node import RegionOverlayVisualizer from .flux_attention_cleanup_node import FluxAttentionCleanup -print("Initializing ControlAltAI Nodes") - NODE_CLASS_MAPPINGS = { "FluxResolutionNode": FluxResolutionNode, "FluxSampler": FluxSampler, diff --git a/import_error_solution.txt b/import_error_solution.txt new file mode 100644 index 0000000..5a5e61f --- /dev/null +++ b/import_error_solution.txt @@ -0,0 +1,22 @@ +XFormers is now needed for the flux region spatial control to work. + +Go to your python_embeded folder and Check your pytorch and cuda version: + +python.exe -c "import torch; print(torch.__version__)" + +Please go to: https://github.com/facebookresearch/xformers/releases + +Check for the latest Xformers version that is compatible with your installed Pytorch version. + +You can Install the latest version of xformers using this command: + +python.exe -m pip install xformers==PUTVERSIONHERE --index-url https://download.pytorch.org/whl/cuVERSION + +example: +python.exe -m pip install xformers==0.0.28.post3 --index-url https://download.pytorch.org/whl/cu124 + +As of 8th December 2024: +Recommended: +xformers==0.0.28.post3 +PyTorch 2.5.1 +CUDA version: cu124 (for CUDA 12.4) \ No newline at end of file