fix python lint

This commit is contained in:
hongbo.mo
2025-10-15 10:55:20 +08:00
parent cd5d69e623
commit 4bbd9b5839
3 changed files with 11 additions and 15 deletions
@@ -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
+1 -1
View File
@@ -6,4 +6,4 @@ NODE_CLASS_MAPPINGS = {
NODE_DISPLAY_NAME_MAPPINGS = {
"MusubiUNETLoader": "Musubi UNET Loader",
}
}
+5 -9
View File
@@ -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,)
return (model,)