diff --git a/.github/workflows/pylint.yml b/.github/workflows/ruff.yml similarity index 66% rename from .github/workflows/pylint.yml rename to .github/workflows/ruff.yml index c73e032..3b7dcac 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/ruff.yml @@ -1,4 +1,4 @@ -name: Pylint +name: Ruff on: [push] @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pylint - - name: Analysing the code with pylint + pip install ruff + - name: Analysing the code with ruff run: | - pylint $(git ls-files '*.py') + ruff check . --select F,E,W,C --statistics --ignore E501,C901 diff --git a/__init__.py b/__init__.py index bb65c99..bf7d28d 100644 --- a/__init__.py +++ b/__init__.py @@ -6,4 +6,4 @@ NODE_CLASS_MAPPINGS = { NODE_DISPLAY_NAME_MAPPINGS = { "MusubiUNETLoader": "Musubi UNET Loader", -} \ No newline at end of file +} diff --git a/modules/nodes.py b/modules/nodes.py index caaf5e6..7e4f1ff 100644 --- a/modules/nodes.py +++ b/modules/nodes.py @@ -1,10 +1,6 @@ import torch import comfy.sd -import comfy.utils -import comfy.model_patcher -from comfy.supported_models import QwenImage -import comfy.model_management import folder_paths from .comfy_ops import block_scaled_fp8_ops @@ -22,12 +18,12 @@ class MusubiUNETLoader: "block_size": ("INT", {"default": 64}), } } - + RETURN_TYPES = ("MODEL",) FUNCTION = "load_unet" CATEGORY = "musubi" - def load_unet(self, unet_name, weight_dtype, block_size=16): + def load_unet(self, unet_name, weight_dtype, block_size=64): model_options = {} dtype = None if weight_dtype == "fp8_e5m2": @@ -35,10 +31,10 @@ class MusubiUNETLoader: elif weight_dtype == "fp8_e4m3fn": dtype = torch.float8_e4m3fn model_options["dtype"] = dtype - + if block_size is not None and block_size > 1: model_options["custom_operations"] = block_scaled_fp8_ops(dtype, block_size) - + unet_path = folder_paths.get_full_path_or_raise("diffusion_models", unet_name) model = comfy.sd.load_diffusion_model(unet_path, model_options=model_options) - return (model,) \ No newline at end of file + return (model,)