Skip to content

Commit 3734af8

Browse files
yiyixuxua-r-r-o-w
andauthored
Apply suggestions from code review
Co-authored-by: Aryan <[email protected]>
1 parent 1de087e commit 3734af8

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

src/diffusers/models/transformers/sana_transformer.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ def forward(
9797

9898

9999
class SanaCombinedTimestepGuidanceEmbeddings(nn.Module):
100-
"""
101-
For Sana.
102-
103-
Reference:
104-
"""
105-
106100
def __init__(self, embedding_dim):
107101
super().__init__()
108102
self.time_proj = Timesteps(num_channels=256, flip_sin_to_cos=True, downscale_freq_shift=0)

src/diffusers/pipelines/sana/pipeline_sana_sprint.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -394,24 +394,6 @@ def encode_prompt(
394394

395395
return prompt_embeds, prompt_attention_mask
396396

397-
# Copied from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline.prepare_extra_step_kwargs
398-
def prepare_extra_step_kwargs(self, generator, eta):
399-
# prepare extra kwargs for the scheduler step, since not all schedulers have the same signature
400-
# eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.
401-
# eta corresponds to η in DDIM paper: https://arxiv.org/abs/2010.02502
402-
# and should be between [0, 1]
403-
404-
accepts_eta = "eta" in set(inspect.signature(self.scheduler.step).parameters.keys())
405-
extra_step_kwargs = {}
406-
if accepts_eta:
407-
extra_step_kwargs["eta"] = eta
408-
409-
# check if the scheduler accepts generator
410-
accepts_generator = "generator" in set(inspect.signature(self.scheduler.step).parameters.keys())
411-
if accepts_generator:
412-
extra_step_kwargs["generator"] = generator
413-
return extra_step_kwargs
414-
415397
def check_inputs(
416398
self,
417399
prompt,
@@ -853,9 +835,6 @@ def __call__(
853835
guidance = guidance.expand(latents.shape[0]).to(prompt_embeds.dtype)
854836
guidance = guidance * self.transformer.config.guidance_embeds_scale
855837

856-
# 6. Prepare extra step kwargs. TODO: Logic should ideally just be moved out of the pipeline
857-
extra_step_kwargs = self.prepare_extra_step_kwargs(generator, eta)
858-
859838
# YiYi TODO: refactor this
860839
timesteps = timesteps[:-1]
861840

src/diffusers/schedulers/scheduling_scm.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ class SCMScheduler(SchedulerMixin, ConfigMixin):
5959
The number of diffusion steps to train the model.
6060
prediction_type (`str`, defaults to `trigflow`):
6161
Prediction type of the scheduler function. Currently only supports "trigflow".
62-
max_timesteps (`float`, defaults to 1.57080):
63-
The maximum timestep value used in the diffusion process.
64-
intermediate_timesteps (`float`, *optional*, defaults to 1.3):
65-
The intermediate timestep value used when num_inference_steps=2.
6662
sigma_data (`float`, defaults to 0.5):
6763
The standard deviation of the noise added during multi-step inference.
6864
"""
@@ -220,9 +216,7 @@ def step(
220216
sample (`torch.FloatTensor`):
221217
A current instance of a sample created by the diffusion process.
222218
return_dict (`bool`, *optional*, defaults to `True`):
223-
itself. Useful for methods such as [`CycleDiffusion`].
224-
return_dict (`bool`, *optional*, defaults to `True`):
225-
Whether or not to return a [`~schedulers.scheduling_lcm.LCMSchedulerOutput`] or `tuple`.
219+
Whether or not to return a [`~schedulers.scheduling_scm.SCMSchedulerOutput`] or `tuple`.
226220
Returns:
227221
[`~schedulers.scheduling_utils.SCMSchedulerOutput`] or `tuple`:
228222
If return_dict is `True`, [`~schedulers.scheduling_scm.SCMSchedulerOutput`] is returned, otherwise a

0 commit comments

Comments
 (0)