Skip to content

Commit 628f2c5

Browse files
hlkysayakpaul
andauthored
Use Pipelines without scheduler (#10439)
Co-authored-by: Sayak Paul <[email protected]>
1 parent 811560b commit 628f2c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+76
-76
lines changed

examples/community/adaptive_mask_inpainting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def __init__(
372372
self.register_adaptive_mask_model()
373373
self.register_adaptive_mask_settings()
374374

375-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
375+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
376376
deprecation_message = (
377377
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
378378
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -386,7 +386,7 @@ def __init__(
386386
new_config["steps_offset"] = 1
387387
scheduler._internal_dict = FrozenDict(new_config)
388388

389-
if hasattr(scheduler.config, "skip_prk_steps") and scheduler.config.skip_prk_steps is False:
389+
if scheduler is not None and getattr(scheduler.config, "skip_prk_steps", True) is False:
390390
deprecation_message = (
391391
f"The configuration file of this scheduler: {scheduler} has not set the configuration"
392392
" `skip_prk_steps`. `skip_prk_steps` should be set to True in the configuration file. Please make"

examples/community/composable_stable_diffusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(
8989
):
9090
super().__init__()
9191

92-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
92+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
9393
deprecation_message = (
9494
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
9595
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -103,7 +103,7 @@ def __init__(
103103
new_config["steps_offset"] = 1
104104
scheduler._internal_dict = FrozenDict(new_config)
105105

106-
if hasattr(scheduler.config, "clip_sample") and scheduler.config.clip_sample is True:
106+
if scheduler is not None and getattr(scheduler.config, "clip_sample", False) is True:
107107
deprecation_message = (
108108
f"The configuration file of this scheduler: {scheduler} has not set the configuration `clip_sample`."
109109
" `clip_sample` should be set to False in the configuration file. Please make sure to update the"

examples/community/img2img_inpainting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(
9595
):
9696
super().__init__()
9797

98-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
98+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
9999
deprecation_message = (
100100
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
101101
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "

examples/community/instaflow_one_step.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def __init__(
109109
):
110110
super().__init__()
111111

112-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
112+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
113113
deprecation_message = (
114114
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
115115
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -123,7 +123,7 @@ def __init__(
123123
new_config["steps_offset"] = 1
124124
scheduler._internal_dict = FrozenDict(new_config)
125125

126-
if hasattr(scheduler.config, "clip_sample") and scheduler.config.clip_sample is True:
126+
if scheduler is not None and getattr(scheduler.config, "clip_sample", False) is True:
127127
deprecation_message = (
128128
f"The configuration file of this scheduler: {scheduler} has not set the configuration `clip_sample`."
129129
" `clip_sample` should be set to False in the configuration file. Please make sure to update the"

examples/community/interpolate_stable_diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__(
8686
):
8787
super().__init__()
8888

89-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
89+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
9090
deprecation_message = (
9191
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
9292
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "

examples/community/ip_adapter_face_id.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def __init__(
191191
):
192192
super().__init__()
193193

194-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
194+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
195195
deprecation_message = (
196196
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
197197
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -205,7 +205,7 @@ def __init__(
205205
new_config["steps_offset"] = 1
206206
scheduler._internal_dict = FrozenDict(new_config)
207207

208-
if hasattr(scheduler.config, "clip_sample") and scheduler.config.clip_sample is True:
208+
if scheduler is not None and getattr(scheduler.config, "clip_sample", False) is True:
209209
deprecation_message = (
210210
f"The configuration file of this scheduler: {scheduler} has not set the configuration `clip_sample`."
211211
" `clip_sample` should be set to False in the configuration file. Please make sure to update the"

examples/community/llm_grounded_diffusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def __init__(
336336
# This is copied from StableDiffusionPipeline, with hook initizations for LMD+.
337337
super().__init__()
338338

339-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
339+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
340340
deprecation_message = (
341341
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
342342
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -350,7 +350,7 @@ def __init__(
350350
new_config["steps_offset"] = 1
351351
scheduler._internal_dict = FrozenDict(new_config)
352352

353-
if hasattr(scheduler.config, "clip_sample") and scheduler.config.clip_sample is True:
353+
if scheduler is not None and getattr(scheduler.config, "clip_sample", False) is True:
354354
deprecation_message = (
355355
f"The configuration file of this scheduler: {scheduler} has not set the configuration `clip_sample`."
356356
" `clip_sample` should be set to False in the configuration file. Please make sure to update the"

examples/community/lpw_stable_diffusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def __init__(
496496
):
497497
super().__init__()
498498

499-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
499+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
500500
deprecation_message = (
501501
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
502502
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -510,7 +510,7 @@ def __init__(
510510
new_config["steps_offset"] = 1
511511
scheduler._internal_dict = FrozenDict(new_config)
512512

513-
if hasattr(scheduler.config, "clip_sample") and scheduler.config.clip_sample is True:
513+
if scheduler is not None and getattr(scheduler.config, "clip_sample", False) is True:
514514
deprecation_message = (
515515
f"The configuration file of this scheduler: {scheduler} has not set the configuration `clip_sample`."
516516
" `clip_sample` should be set to False in the configuration file. Please make sure to update the"

examples/community/matryoshka.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3766,7 +3766,7 @@ def __init__(
37663766
else:
37673767
raise ValueError("Currently, nesting levels 0, 1, and 2 are supported.")
37683768

3769-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
3769+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
37703770
deprecation_message = (
37713771
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
37723772
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -3780,7 +3780,7 @@ def __init__(
37803780
new_config["steps_offset"] = 1
37813781
scheduler._internal_dict = FrozenDict(new_config)
37823782

3783-
# if hasattr(scheduler.config, "clip_sample") and scheduler.config.clip_sample is True:
3783+
# if scheduler is not None and getattr(scheduler.config, "clip_sample", False) is True:
37843784
# deprecation_message = (
37853785
# f"The configuration file of this scheduler: {scheduler} has not set the configuration `clip_sample`."
37863786
# " `clip_sample` should be set to False in the configuration file. Please make sure to update the"

examples/community/multilingual_stable_diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(
9898
):
9999
super().__init__()
100100

101-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
101+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
102102
deprecation_message = (
103103
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
104104
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "

0 commit comments

Comments
 (0)