Skip to content

Commit 5316620

Browse files
Complete rollback of diffusers core files
1 parent 1049663 commit 5316620

30 files changed

+4
-36
lines changed

src/diffusers/pipelines/flux/pipeline_flux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
import inspect
16-
from typing import Any, Callable, Dict, List, Optional, Union, Tuple
17-
import copy
16+
from typing import Any, Callable, Dict, List, Optional, Union
17+
1818
import numpy as np
1919
import torch
2020
from transformers import (

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from pathlib import Path
2424
from typing import Any, Callable, Dict, List, Optional, Union, get_args, get_origin
2525

26-
2726
import numpy as np
2827
import PIL.Image
2928
import requests
@@ -179,7 +178,6 @@ def __init__(self, *args, **kwargs):
179178
super().__init__(*args, **kwargs)
180179

181180

182-
183181
class DiffusionPipeline(ConfigMixin, PushToHubMixin):
184182
r"""
185183
Base class for all pipelines.

src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414
import inspect
1515
from typing import Any, Callable, Dict, List, Optional, Union
16+
1617
import torch
1718
from packaging import version
1819
from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer, CLIPVisionModelWithProjection
@@ -150,7 +151,6 @@ def retrieve_timesteps(
150151
return timesteps, num_inference_steps
151152

152153

153-
154154
class StableDiffusionPipeline(
155155
DiffusionPipeline,
156156
StableDiffusionMixin,

src/diffusers/pipelines/stable_diffusion_3/pipeline_stable_diffusion_3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import inspect
1616
from typing import Any, Callable, Dict, List, Optional, Union
17+
1718
import torch
1819
from transformers import (
1920
CLIPTextModelWithProjection,

src/diffusers/schedulers/scheduling_amused.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,3 @@ def add_noise(self, sample, timesteps, generator=None):
160160
masked_sample[mask_indices] = self.config.mask_token_id
161161

162162
return masked_sample
163-

src/diffusers/schedulers/scheduling_consistency_decoder.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ def set_timesteps(
109109
self.c_out = self.c_out.to(device)
110110
self.c_in = self.c_in.to(device)
111111

112-
113-
114112
@property
115113
def init_noise_sigma(self):
116114
return self.sqrt_one_minus_alphas_cumprod[self.timesteps[0]]

src/diffusers/schedulers/scheduling_consistency_models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ def set_timesteps(
243243
self._begin_index = None
244244
self.sigmas = self.sigmas.to("cpu") # to avoid too much CPU/GPU communication
245245

246-
247246
# Modified _convert_to_karras implementation that takes in ramp as argument
248247
def _convert_to_karras(self, ramp):
249248
"""Constructs the noise schedule of Karras et al. (2022)."""

src/diffusers/schedulers/scheduling_cosine_dpmsolver_multistep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ def set_timesteps(self, num_inference_steps: int = None, device: Union[str, torc
241241
# if a noise sampler is used, reinitialise it
242242
self.noise_sampler = None
243243

244-
245244
# Copied from diffusers.schedulers.scheduling_edm_euler.EDMEulerScheduler._compute_karras_sigmas
246245
def _compute_karras_sigmas(self, ramp, sigma_min=None, sigma_max=None) -> torch.Tensor:
247246
"""Constructs the noise schedule of Karras et al. (2022)."""

src/diffusers/schedulers/scheduling_ddim.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ def set_timesteps(self, num_inference_steps: int, device: Union[str, torch.devic
339339

340340
self.timesteps = torch.from_numpy(timesteps).to(device)
341341

342-
343342
def step(
344343
self,
345344
model_output: torch.Tensor,

src/diffusers/schedulers/scheduling_ddim_cogvideox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ def set_timesteps(self, num_inference_steps: int, device: Union[str, torch.devic
302302

303303
self.timesteps = torch.from_numpy(timesteps).to(device)
304304

305-
306305
def step(
307306
self,
308307
model_output: torch.Tensor,

0 commit comments

Comments
 (0)