Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/diffusers/pipelines/pipeline_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@

logger = logging.get_logger(__name__)

class NotTQDMNoOp:
def __init__(*args, **kwargs):
return
def __enter__(self, *args, **kwargs):
return self
def __exit__(*args, **kwargs):
return
def update(*args, **kwargs):
return


@dataclass
class ImagePipelineOutput(BaseOutput):
Expand Down Expand Up @@ -1560,6 +1570,8 @@ def progress_bar(self, iterable=None, total=None):
f"`self._progress_bar_config` should be of type `dict`, but is {type(self._progress_bar_config)}."
)

if self._progress_bar_config.get('disable', False) == True:
return NotTQDMNoOp()
if iterable is not None:
return tqdm(iterable, **self._progress_bar_config)
elif total is not None:
Expand Down