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 "

examples/community/pipeline_prompt2prompt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __init__(
131131
):
132132
super().__init__()
133133

134-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
134+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
135135
deprecation_message = (
136136
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
137137
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -145,7 +145,7 @@ def __init__(
145145
new_config["steps_offset"] = 1
146146
scheduler._internal_dict = FrozenDict(new_config)
147147

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

examples/community/pipeline_stable_diffusion_boxdiff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def __init__(
417417
):
418418
super().__init__()
419419

420-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
420+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
421421
deprecation_message = (
422422
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
423423
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -431,7 +431,7 @@ def __init__(
431431
new_config["steps_offset"] = 1
432432
scheduler._internal_dict = FrozenDict(new_config)
433433

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

examples/community/pipeline_stable_diffusion_pag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def __init__(
384384
):
385385
super().__init__()
386386

387-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
387+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
388388
deprecation_message = (
389389
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
390390
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -398,7 +398,7 @@ def __init__(
398398
new_config["steps_offset"] = 1
399399
scheduler._internal_dict = FrozenDict(new_config)
400400

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

examples/community/pipeline_zero1to3.py

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

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

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

examples/community/stable_diffusion_ipex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def __init__(
105105
):
106106
super().__init__()
107107

108-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
108+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
109109
deprecation_message = (
110110
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
111111
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -119,7 +119,7 @@ def __init__(
119119
new_config["steps_offset"] = 1
120120
scheduler._internal_dict = FrozenDict(new_config)
121121

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

examples/community/stable_diffusion_mega.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
requires_safety_checker: bool = True,
6767
):
6868
super().__init__()
69-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
69+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
7070
deprecation_message = (
7171
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
7272
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "

examples/community/stable_diffusion_reference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def __init__(
132132
):
133133
super().__init__()
134134

135-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
135+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
136136
deprecation_message = (
137137
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
138138
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -146,7 +146,7 @@ def __init__(
146146
new_config["steps_offset"] = 1
147147
scheduler._internal_dict = FrozenDict(new_config)
148148

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

examples/community/stable_diffusion_repaint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def __init__(
187187
):
188188
super().__init__()
189189

190-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
190+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
191191
deprecation_message = (
192192
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
193193
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -201,7 +201,7 @@ def __init__(
201201
new_config["steps_offset"] = 1
202202
scheduler._internal_dict = FrozenDict(new_config)
203203

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

examples/community/stable_diffusion_tensorrt_img2img.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ def __init__(
710710
):
711711
super().__init__()
712712

713-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
713+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
714714
deprecation_message = (
715715
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
716716
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -724,7 +724,7 @@ def __init__(
724724
new_config["steps_offset"] = 1
725725
scheduler._internal_dict = FrozenDict(new_config)
726726

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

examples/community/stable_diffusion_tensorrt_inpaint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ def __init__(
714714
):
715715
super().__init__()
716716

717-
if hasattr(scheduler.config, "steps_offset") and scheduler.config.steps_offset != 1:
717+
if scheduler is not None and getattr(scheduler.config, "steps_offset", 1) != 1:
718718
deprecation_message = (
719719
f"The configuration file of this scheduler: {scheduler} is outdated. `steps_offset`"
720720
f" should be set to 1 instead of {scheduler.config.steps_offset}. Please make sure "
@@ -728,7 +728,7 @@ def __init__(
728728
new_config["steps_offset"] = 1
729729
scheduler._internal_dict = FrozenDict(new_config)
730730

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

0 commit comments

Comments
 (0)