Fix model_management import so it doesn't get executed twice.

This commit is contained in:
comfyanonymous
2023-04-15 18:55:17 -04:00
parent 81d1f00df3
commit 73c3e11e83
7 changed files with 14 additions and 14 deletions

View File

@@ -9,7 +9,7 @@ from typing import Optional, Any
from ldm.modules.diffusionmodules.util import checkpoint
from .sub_quadratic_attention import efficient_dot_product_attention
import model_management
from comfy import model_management
from . import tomesd

View File

@@ -7,7 +7,7 @@ from einops import rearrange
from typing import Optional, Any
from ldm.modules.attention import MemoryEfficientCrossAttention
import model_management
from comfy import model_management
if model_management.xformers_enabled_vae():
import xformers

View File

@@ -24,7 +24,7 @@ except ImportError:
from torch import Tensor
from typing import List
import model_management
from comfy import model_management
def dynamic_slice(
x: Tensor,

View File

@@ -3,7 +3,7 @@ from .k_diffusion import external as k_diffusion_external
from .extra_samplers import uni_pc
import torch
import contextlib
import model_management
from comfy import model_management
from .ldm.models.diffusion.ddim import DDIMSampler
from .ldm.modules.diffusionmodules.util import make_ddim_timesteps

View File

@@ -4,7 +4,7 @@ import copy
import sd1_clip
import sd2_clip
import model_management
from comfy import model_management
from .ldm.util import instantiate_from_config
from .ldm.models.autoencoder import AutoencoderKL
import yaml
@@ -388,7 +388,7 @@ class CLIP:
return cond
def encode(self, text):
tokens = self.tokenizer.tokenize_with_weights(text)
tokens = self.tokenize(text)
return self.encode_from_tokens(tokens)
class VAE: