Skip to content

Commit c1c4269

Browse files
authored
Remove dead code and fix f-string issue (#7720)
* Remove dead code * PylancereportGeneralTypeIssues: Strings nested within an f-string cannot use the same quote character as the f-string prior to Python 3.12. * Remove dead code
1 parent 75aab34 commit c1c4269

File tree

4 files changed

+1
-11
lines changed

4 files changed

+1
-11
lines changed

examples/community/checkpoint_merger.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def merge(self, pretrained_model_name_or_path_list: List[Union[str, os.PathLike]
138138
comparison_result &= self._compare_model_configs(config_dicts[idx - 1], config_dicts[idx])
139139
if not force and comparison_result is False:
140140
raise ValueError("Incompatible checkpoints. Please check model_index.json for the models.")
141-
print(config_dicts[0], config_dicts[1])
142141
print("Compatible model_index.json files found")
143142
# Step 2: Basic Validation has succeeded. Let's download the models and save them into our local files.
144143
cached_folders = []

examples/community/latent_consistency_img2img.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,6 @@ def prepare_latents(
240240

241241
return latents
242242

243-
if latents is None:
244-
latents = torch.randn(shape, dtype=dtype).to(device)
245-
else:
246-
latents = latents.to(device)
247-
# scale the initial noise by the standard deviation required by the scheduler
248-
latents = latents * self.scheduler.init_noise_sigma
249-
return latents
250-
251243
def get_w_embedding(self, w, embedding_dim=512, dtype=torch.float32):
252244
"""
253245
see https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298

scripts/convert_zero123_to_diffusers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def create_unet_diffusers_config(original_config, image_size: int, controlnet=Fa
113113
assert "adm_in_channels" in unet_params
114114
projection_class_embeddings_input_dim = unet_params["adm_in_channels"]
115115
else:
116-
raise NotImplementedError(f"Unknown conditional unet num_classes config: {unet_params["num_classes"]}")
116+
raise NotImplementedError(f"Unknown conditional unet num_classes config: {unet_params['num_classes']}")
117117

118118
config = {
119119
"sample_size": image_size // vae_scale_factor,

src/diffusers/image_processor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def __init__(
8080
" if you intended to convert the image into RGB format, please set `do_convert_grayscale = False`.",
8181
" if you intended to convert the image into grayscale format, please set `do_convert_rgb = False`",
8282
)
83-
self.config.do_convert_rgb = False
8483

8584
@staticmethod
8685
def numpy_to_pil(images: np.ndarray) -> List[PIL.Image.Image]:

0 commit comments

Comments
 (0)