mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-23 12:50:18 +08:00
Fix pylint issues
This commit is contained in:
parent
fd00368437
commit
ccdbd957ef
@ -1,2 +0,0 @@
|
|||||||
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fast
|
|
||||||
pause
|
|
||||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -39,8 +39,8 @@ jobs:
|
|||||||
- name: Lint for errors
|
- name: Lint for errors
|
||||||
run: |
|
run: |
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
pylint --rcfile=.pylintrc comfy/
|
pylint -j 8 --rcfile=.pylintrc comfy/
|
||||||
pylint --rcfile=.pylintrc comfy_extras/
|
pylint -j 8 --rcfile=.pylintrc comfy_extras/
|
||||||
build_and_execute_linux:
|
build_and_execute_linux:
|
||||||
environment: "Testing"
|
environment: "Testing"
|
||||||
name: Installation, Unit and Workflow Tests for Linux
|
name: Installation, Unit and Workflow Tests for Linux
|
||||||
|
|||||||
@ -15,7 +15,7 @@ supported_pt_extensions = _supported_pt_extensions
|
|||||||
|
|
||||||
# todo: this should be initialized elsewhere
|
# todo: this should be initialized elsewhere
|
||||||
if 'main.py' in sys.argv:
|
if 'main.py' in sys.argv:
|
||||||
base_path = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../.."))
|
base_path = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../..")) # pylint: disable=used-before-assignment
|
||||||
elif args.cwd is not None:
|
elif args.cwd is not None:
|
||||||
if not os.path.exists(args.cwd):
|
if not os.path.exists(args.cwd):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -113,8 +113,8 @@ class SVGToImage(CustomNode):
|
|||||||
try:
|
try:
|
||||||
cleaned_svg = self.clean_svg_string(svg_string)
|
cleaned_svg = self.clean_svg_string(svg_string)
|
||||||
|
|
||||||
stream = skia.MemoryStream(cleaned_svg.encode('utf-8'), True)
|
stream = skia.MemoryStream(cleaned_svg.encode('utf-8'), True) # pylint: disable=c-extension-no-member
|
||||||
svg_dom = skia.SVGDOM.MakeFromStream(stream)
|
svg_dom = skia.SVGDOM.MakeFromStream(stream) # pylint: disable=c-extension-no-member
|
||||||
|
|
||||||
if svg_dom is None:
|
if svg_dom is None:
|
||||||
raise ValueError(f"Failed to parse SVG content for image {i}")
|
raise ValueError(f"Failed to parse SVG content for image {i}")
|
||||||
@ -125,9 +125,9 @@ class SVGToImage(CustomNode):
|
|||||||
width = int(svg_width * scale)
|
width = int(svg_width * scale)
|
||||||
height = int(svg_height * scale)
|
height = int(svg_height * scale)
|
||||||
|
|
||||||
surface = skia.Surface(width, height)
|
surface = skia.Surface(width, height) # pylint: disable=c-extension-no-member
|
||||||
with surface as canvas:
|
with surface as canvas:
|
||||||
canvas.clear(skia.ColorTRANSPARENT)
|
canvas.clear(skia.ColorTRANSPARENT) # pylint: disable=c-extension-no-member
|
||||||
|
|
||||||
canvas.scale(scale, scale)
|
canvas.scale(scale, scale)
|
||||||
svg_dom.render(canvas)
|
svg_dom.render(canvas)
|
||||||
@ -153,7 +153,6 @@ class SVGToImage(CustomNode):
|
|||||||
if not raster_images:
|
if not raster_images:
|
||||||
raise ValueError("No valid images were generated from the input SVGs")
|
raise ValueError("No valid images were generated from the input SVGs")
|
||||||
|
|
||||||
# Stack all images into a single batch
|
|
||||||
batch = torch.stack(raster_images)
|
batch = torch.stack(raster_images)
|
||||||
|
|
||||||
return (batch,)
|
return (batch,)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user