From 0920e0e5febc852cfc5496ac2ba6b44d12b5b35c Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 27 May 2024 19:03:56 -0400 Subject: [PATCH] Remove some unused imports. --- comfy/ldm/cascade/stage_b.py | 1 - comfy/ldm/cascade/stage_c.py | 1 - comfy/ldm/models/autoencoder.py | 2 -- comfy/ldm/modules/attention.py | 2 +- comfy/model_management.py | 1 - comfy/sd.py | 1 - comfy/sd2_clip.py | 1 - comfy_extras/nodes_canny.py | 7 +------ comfy_extras/nodes_sag.py | 1 - comfy_extras/nodes_sdupscale.py | 1 - 10 files changed, 2 insertions(+), 16 deletions(-) diff --git a/comfy/ldm/cascade/stage_b.py b/comfy/ldm/cascade/stage_b.py index 6d2c2223..7c3d8fea 100644 --- a/comfy/ldm/cascade/stage_b.py +++ b/comfy/ldm/cascade/stage_b.py @@ -17,7 +17,6 @@ """ import math -import numpy as np import torch from torch import nn from .common import AttnBlock, LayerNorm2d_op, ResBlock, FeedForwardBlock, TimestepBlock diff --git a/comfy/ldm/cascade/stage_c.py b/comfy/ldm/cascade/stage_c.py index 67c1e52b..c85da1f0 100644 --- a/comfy/ldm/cascade/stage_c.py +++ b/comfy/ldm/cascade/stage_c.py @@ -18,7 +18,6 @@ import torch from torch import nn -import numpy as np import math from .common import AttnBlock, LayerNorm2d_op, ResBlock, FeedForwardBlock, TimestepBlock # from .controlnet import ControlNetDeliverer diff --git a/comfy/ldm/models/autoencoder.py b/comfy/ldm/models/autoencoder.py index b91ec324..f5f4de28 100644 --- a/comfy/ldm/models/autoencoder.py +++ b/comfy/ldm/models/autoencoder.py @@ -1,6 +1,4 @@ import torch -# import pytorch_lightning as pl -import torch.nn.functional as F from contextlib import contextmanager from typing import Any, Dict, List, Optional, Tuple, Union diff --git a/comfy/ldm/modules/attention.py b/comfy/ldm/modules/attention.py index 93c94458..da9f7aab 100644 --- a/comfy/ldm/modules/attention.py +++ b/comfy/ldm/modules/attention.py @@ -3,7 +3,7 @@ import torch import torch.nn.functional as F from torch import nn, einsum from einops import rearrange, repeat -from typing import Optional, Any +from typing import Optional import logging from .diffusionmodules.util import AlphaBlender, timestep_embedding diff --git a/comfy/model_management.py b/comfy/model_management.py index ef36a2c4..5c1afd3d 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -2,7 +2,6 @@ import psutil import logging from enum import Enum from comfy.cli_args import args -import comfy.utils import torch import sys import platform diff --git a/comfy/sd.py b/comfy/sd.py index 8044c184..343d2a02 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -14,7 +14,6 @@ import comfy.utils from . import clip_vision from . import gligen from . import diffusers_convert -from . import model_base from . import model_detection from . import sd1_clip diff --git a/comfy/sd2_clip.py b/comfy/sd2_clip.py index 9c878d54..d14b4454 100644 --- a/comfy/sd2_clip.py +++ b/comfy/sd2_clip.py @@ -1,5 +1,4 @@ from comfy import sd1_clip -import torch import os class SD2ClipHModel(sd1_clip.SDClipModel): diff --git a/comfy_extras/nodes_canny.py b/comfy_extras/nodes_canny.py index fab2ab7a..d85e6b85 100644 --- a/comfy_extras/nodes_canny.py +++ b/comfy_extras/nodes_canny.py @@ -1,10 +1,5 @@ -import math - -import torch -import torch.nn.functional as F -import comfy.model_management - from kornia.filters import canny +import comfy.model_management class Canny: diff --git a/comfy_extras/nodes_sag.py b/comfy_extras/nodes_sag.py index 8d786db5..010e9974 100644 --- a/comfy_extras/nodes_sag.py +++ b/comfy_extras/nodes_sag.py @@ -4,7 +4,6 @@ import torch.nn.functional as F import math from einops import rearrange, repeat -import os from comfy.ldm.modules.attention import optimized_attention import comfy.samplers diff --git a/comfy_extras/nodes_sdupscale.py b/comfy_extras/nodes_sdupscale.py index 28c1cb0f..bba67e8d 100644 --- a/comfy_extras/nodes_sdupscale.py +++ b/comfy_extras/nodes_sdupscale.py @@ -1,5 +1,4 @@ import torch -import nodes import comfy.utils class SD_4XUpscale_Conditioning: