From 1a829bb998f3f28f35f8d3801d1447e9c3abea10 Mon Sep 17 00:00:00 2001 From: Kevin Turner <83819+keturn@users.noreply.github.com> Date: Thu, 9 Mar 2023 18:04:11 -0800 Subject: [PATCH] pipeline: remove code for legacy model --- invokeai/backend/generate.py | 12 ---------- .../stable_diffusion/diffusers_pipeline.py | 24 ------------------- 2 files changed, 36 deletions(-) diff --git a/invokeai/backend/generate.py b/invokeai/backend/generate.py index ee5241bca1..35dba41ffb 100644 --- a/invokeai/backend/generate.py +++ b/invokeai/backend/generate.py @@ -495,18 +495,6 @@ class Generate: torch.cuda.reset_peak_memory_stats() results = list() - init_image = None - mask_image = None - - try: - if ( - self.free_gpu_mem - and self.model.cond_stage_model.device != self.model.device - ): - self.model.cond_stage_model.device = self.model.device - self.model.cond_stage_model.to(self.model.device) - except AttributeError: - pass try: uc, c, extra_conditioning_info = get_uc_and_c_and_ec( diff --git a/invokeai/backend/stable_diffusion/diffusers_pipeline.py b/invokeai/backend/stable_diffusion/diffusers_pipeline.py index c97b122728..51e7b1ee1d 100644 --- a/invokeai/backend/stable_diffusion/diffusers_pipeline.py +++ b/invokeai/backend/stable_diffusion/diffusers_pipeline.py @@ -54,16 +54,6 @@ class PipelineIntermediateState: attention_map_saver: Optional[AttentionMapSaver] = None -# copied from configs/stable-diffusion/v1-inference.yaml -_default_personalization_config_params = dict( - placeholder_strings=["*"], - initializer_wods=["sculpture"], - per_image_tokens=False, - num_vectors_per_token=1, - progressive_words=False, -) - - @dataclass class AddsMaskLatents: """Add the channels required for inpainting model input. @@ -917,20 +907,6 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline): device=self._model_group.device_for(self.unet), ) - @property - def cond_stage_model(self): - return self.embeddings_provider - - @torch.inference_mode() - def _tokenize(self, prompt: Union[str, List[str]]): - return self.tokenizer( - prompt, - padding="max_length", - max_length=self.tokenizer.model_max_length, - truncation=True, - return_tensors="pt", - ) - @property def channels(self) -> int: """Compatible with DiffusionWrapper"""