Skip to content

Commit 25f4600

Browse files
authored
Merge branch 'main' into cnet-union-img2img-fixes
2 parents 1e134d3 + c5d6e0b commit 25f4600

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

src/diffusers/configuration_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,4 +763,7 @@ def from_config(cls, config: Union[FrozenDict, Dict[str, Any]] = None, return_un
763763
# resolve remapping
764764
remapped_class = _fetch_remapped_cls_from_config(config, cls)
765765

766-
return remapped_class.from_config(config, return_unused_kwargs, **kwargs)
766+
if remapped_class is cls:
767+
return super(LegacyConfigMixin, remapped_class).from_config(config, return_unused_kwargs, **kwargs)
768+
else:
769+
return remapped_class.from_config(config, return_unused_kwargs, **kwargs)

src/diffusers/models/modeling_utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1877,4 +1877,9 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
18771877
# resolve remapping
18781878
remapped_class = _fetch_remapped_cls_from_config(config, cls)
18791879

1880-
return remapped_class.from_pretrained(pretrained_model_name_or_path, **kwargs_copy)
1880+
if remapped_class is cls:
1881+
return super(LegacyModelMixin, remapped_class).from_pretrained(
1882+
pretrained_model_name_or_path, **kwargs_copy
1883+
)
1884+
else:
1885+
return remapped_class.from_pretrained(pretrained_model_name_or_path, **kwargs_copy)

src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ def __call__(
383383
# set timesteps
384384
self.scheduler.set_timesteps(num_inference_steps)
385385

386-
latents = latents * np.float64(self.scheduler.init_noise_sigma)
386+
# scale the initial noise by the standard deviation required by the scheduler
387+
latents = latents * self.scheduler.init_noise_sigma
387388

388389
# prepare extra kwargs for the scheduler step, since not all schedulers have the same signature
389390
# eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.

src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def __call__(
483483
self.scheduler.set_timesteps(num_inference_steps)
484484

485485
# scale the initial noise by the standard deviation required by the scheduler
486-
latents = latents * np.float64(self.scheduler.init_noise_sigma)
486+
latents = latents * self.scheduler.init_noise_sigma
487487

488488
# prepare extra kwargs for the scheduler step, since not all schedulers have the same signature
489489
# eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.

src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_upscale.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def __call__(
481481
timesteps = self.scheduler.timesteps
482482

483483
# Scale the initial noise by the standard deviation required by the scheduler
484-
latents = latents * np.float64(self.scheduler.init_noise_sigma)
484+
latents = latents * self.scheduler.init_noise_sigma
485485

486486
# 5. Add noise to image
487487
noise_level = np.array([noise_level]).astype(np.int64)

0 commit comments

Comments
 (0)