Diffusers documentation


You are viewing v0.12.0 version. A newer version v0.29.2 is available.
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started


🧨 Diffusers has a centralized logging system, so that you can setup the verbosity of the library easily.

Currently the default verbosity of the library is WARNING.

To change the level of verbosity, just use one of the direct setters. For instance, here is how to change the verbosity to the INFO level.

import diffusers


You can also use the environment variable DIFFUSERS_VERBOSITY to override the default verbosity. You can set it to one of the following: debug, info, warning, error, critical. For example:

DIFFUSERS_VERBOSITY=error ./myprogram.py

Additionally, some warnings can be disabled by setting the environment variable DIFFUSERS_NO_ADVISORY_WARNINGS to a true value, like 1. This will disable any warning that is logged using logger.warning_advice. For example:


Here is an example of how to use the same logger as the library in your own module or script:

from diffusers.utils import logging

logger = logging.get_logger("diffusers")

All the methods of this logging module are documented below, the main ones are logging.get_verbosity() to get the current level of verbosity in the logger and logging.set_verbosity() to set the verbosity to the level of your choice. In order (from the least verbose to the most verbose), those levels (with their corresponding int values in parenthesis) are:

  • diffusers.logging.CRITICAL or diffusers.logging.FATAL (int value, 50): only report the most critical errors.
  • diffusers.logging.ERROR (int value, 40): only report errors.
  • diffusers.logging.WARNING or diffusers.logging.WARN (int value, 30): only reports error and warnings. This the default level used by the library.
  • diffusers.logging.INFO (int value, 20): reports error, warnings and basic information.
  • diffusers.logging.DEBUG (int value, 10): report all information.

By default, tqdm progress bars will be displayed during model download. logging.disable_progress_bar() and logging.enable_progress_bar() can be used to suppress or unsuppress this behavior.

Base setters


< >

( )

Set the verbosity to the ERROR level.


< >

( )

Set the verbosity to the WARNING level.


< >

( )

Set the verbosity to the INFO level.


< >

( )

Set the verbosity to the DEBUG level.

Other functions


< >

( ) int



The logging level.

Return the current level for the 🤗 Diffusers’ root logger as an int.

🤗 Diffusers has following logging levels:

  • 50: diffusers.logging.CRITICAL or diffusers.logging.FATAL
  • 40: diffusers.logging.ERROR
  • 30: diffusers.logging.WARNING or diffusers.logging.WARN
  • 20: diffusers.logging.INFO
  • 10: diffusers.logging.DEBUG


< >

( verbosity: int )


  • verbosity (int) — Logging level, e.g., one of:

    • diffusers.logging.CRITICAL or diffusers.logging.FATAL
    • diffusers.logging.ERROR
    • diffusers.logging.WARNING or diffusers.logging.WARN
    • diffusers.logging.INFO
    • diffusers.logging.DEBUG

Set the verbosity level for the 🤗 Diffusers’ root logger.


< >

( name: typing.Optional[str] = None )

Return a logger with the specified name.

This function is not supposed to be directly accessed unless you are writing a custom diffusers module.


< >

( )

Enable the default handler of the HuggingFace Diffusers’ root logger.


< >

( )

Disable the default handler of the HuggingFace Diffusers’ root logger.


< >

( )

Enable explicit formatting for every HuggingFace Diffusers’ logger. The explicit formatter is as follows:

All handlers currently bound to the root logger are affected by this method.


< >

( )

Resets the formatting for HuggingFace Diffusers’ loggers.

All handlers currently bound to the root logger are affected by this method.


< >

( )

Enable tqdm progress bar.


< >

( )

Disable tqdm progress bar.