Fix pylint issues

This commit is contained in:
doctorpangloss 2024-08-28 15:48:47 -07:00
parent fd00368437
commit ccdbd957ef
4 changed files with 7 additions and 10 deletions

View File

@ -1,2 +0,0 @@
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fast
pause

View File

@ -39,8 +39,8 @@ jobs:
- name: Lint for errors
run: |
source venv/bin/activate
pylint --rcfile=.pylintrc comfy/
pylint --rcfile=.pylintrc comfy_extras/
pylint -j 8 --rcfile=.pylintrc comfy/
pylint -j 8 --rcfile=.pylintrc comfy_extras/
build_and_execute_linux:
environment: "Testing"
name: Installation, Unit and Workflow Tests for Linux

View File

@ -15,7 +15,7 @@ supported_pt_extensions = _supported_pt_extensions
# todo: this should be initialized elsewhere
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:
if not os.path.exists(args.cwd):
try:

View File

@ -113,8 +113,8 @@ class SVGToImage(CustomNode):
try:
cleaned_svg = self.clean_svg_string(svg_string)
stream = skia.MemoryStream(cleaned_svg.encode('utf-8'), True)
svg_dom = skia.SVGDOM.MakeFromStream(stream)
stream = skia.MemoryStream(cleaned_svg.encode('utf-8'), True) # pylint: disable=c-extension-no-member
svg_dom = skia.SVGDOM.MakeFromStream(stream) # pylint: disable=c-extension-no-member
if svg_dom is None:
raise ValueError(f"Failed to parse SVG content for image {i}")
@ -125,9 +125,9 @@ class SVGToImage(CustomNode):
width = int(svg_width * 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:
canvas.clear(skia.ColorTRANSPARENT)
canvas.clear(skia.ColorTRANSPARENT) # pylint: disable=c-extension-no-member
canvas.scale(scale, scale)
svg_dom.render(canvas)
@ -153,7 +153,6 @@ class SVGToImage(CustomNode):
if not raster_images:
raise ValueError("No valid images were generated from the input SVGs")
# Stack all images into a single batch
batch = torch.stack(raster_images)
return (batch,)