Diffusers BOINC AI docs
  • 🌍GET STARTED
    • Diffusers
    • Quicktour
    • Effective and efficient diffusion
    • Installation
  • 🌍TUTORIALS
    • Overview
    • Understanding models and schedulers
    • AutoPipeline
    • Train a diffusion model
  • 🌍USING DIFFUSERS
    • 🌍LOADING & HUB
      • Overview
      • Load pipelines, models, and schedulers
      • Load and compare different schedulers
      • Load community pipelines
      • Load safetensors
      • Load different Stable Diffusion formats
      • Push files to the Hub
    • 🌍TASKS
      • Unconditional image generation
      • Text-to-image
      • Image-to-image
      • Inpainting
      • Depth-to-image
    • 🌍TECHNIQUES
      • Textual inversion
      • Distributed inference with multiple GPUs
      • Improve image quality with deterministic generation
      • Control image brightness
      • Prompt weighting
    • 🌍PIPELINES FOR INFERENCE
      • Overview
      • Stable Diffusion XL
      • ControlNet
      • Shap-E
      • DiffEdit
      • Distilled Stable Diffusion inference
      • Create reproducible pipelines
      • Community pipelines
      • How to contribute a community pipeline
    • 🌍TRAINING
      • Overview
      • Create a dataset for training
      • Adapt a model to a new task
      • Unconditional image generation
      • Textual Inversion
      • DreamBooth
      • Text-to-image
      • Low-Rank Adaptation of Large Language Models (LoRA)
      • ControlNet
      • InstructPix2Pix Training
      • Custom Diffusion
      • T2I-Adapters
    • 🌍TAKING DIFFUSERS BEYOND IMAGES
      • Other Modalities
  • 🌍OPTIMIZATION/SPECIAL HARDWARE
    • Overview
    • Memory and Speed
    • Torch2.0 support
    • Stable Diffusion in JAX/Flax
    • xFormers
    • ONNX
    • OpenVINO
    • Core ML
    • MPS
    • Habana Gaudi
    • Token Merging
  • 🌍CONCEPTUAL GUIDES
    • Philosophy
    • Controlled generation
    • How to contribute?
    • Diffusers' Ethical Guidelines
    • Evaluating Diffusion Models
  • 🌍API
    • 🌍MAIN CLASSES
      • Attention Processor
      • Diffusion Pipeline
      • Logging
      • Configuration
      • Outputs
      • Loaders
      • Utilities
      • VAE Image Processor
    • 🌍MODELS
      • Overview
      • UNet1DModel
      • UNet2DModel
      • UNet2DConditionModel
      • UNet3DConditionModel
      • VQModel
      • AutoencoderKL
      • AsymmetricAutoencoderKL
      • Tiny AutoEncoder
      • Transformer2D
      • Transformer Temporal
      • Prior Transformer
      • ControlNet
    • 🌍PIPELINES
      • Overview
      • AltDiffusion
      • Attend-and-Excite
      • Audio Diffusion
      • AudioLDM
      • AudioLDM 2
      • AutoPipeline
      • Consistency Models
      • ControlNet
      • ControlNet with Stable Diffusion XL
      • Cycle Diffusion
      • Dance Diffusion
      • DDIM
      • DDPM
      • DeepFloyd IF
      • DiffEdit
      • DiT
      • IF
      • PaInstructPix2Pix
      • Kandinsky
      • Kandinsky 2.2
      • Latent Diffusionge
      • MultiDiffusion
      • MusicLDM
      • PaintByExample
      • Parallel Sampling of Diffusion Models
      • Pix2Pix Zero
      • PNDM
      • RePaint
      • Score SDE VE
      • Self-Attention Guidance
      • Semantic Guidance
      • Shap-E
      • Spectrogram Diffusion
      • 🌍STABLE DIFFUSION
        • Overview
        • Text-to-image
        • Image-to-image
        • Inpainting
        • Depth-to-image
        • Image variation
        • Safe Stable Diffusion
        • Stable Diffusion 2
        • Stable Diffusion XL
        • Latent upscaler
        • Super-resolution
        • LDM3D Text-to-(RGB, Depth)
        • Stable Diffusion T2I-adapter
        • GLIGEN (Grounded Language-to-Image Generation)
      • Stable unCLIP
      • Stochastic Karras VE
      • Text-to-image model editing
      • Text-to-video
      • Text2Video-Zero
      • UnCLIP
      • Unconditional Latent Diffusion
      • UniDiffuser
      • Value-guided sampling
      • Versatile Diffusion
      • VQ Diffusion
      • Wuerstchen
    • 🌍SCHEDULERS
      • Overview
      • CMStochasticIterativeScheduler
      • DDIMInverseScheduler
      • DDIMScheduler
      • DDPMScheduler
      • DEISMultistepScheduler
      • DPMSolverMultistepInverse
      • DPMSolverMultistepScheduler
      • DPMSolverSDEScheduler
      • DPMSolverSinglestepScheduler
      • EulerAncestralDiscreteScheduler
      • EulerDiscreteScheduler
      • HeunDiscreteScheduler
      • IPNDMScheduler
      • KarrasVeScheduler
      • KDPM2AncestralDiscreteScheduler
      • KDPM2DiscreteScheduler
      • LMSDiscreteScheduler
      • PNDMScheduler
      • RePaintScheduler
      • ScoreSdeVeScheduler
      • ScoreSdeVpScheduler
      • UniPCMultistepScheduler
      • VQDiffusionScheduler
Powered by GitBook
On this page
  • Logging
  • Base setters
  • Other functions
  1. API
  2. MAIN CLASSES

Logging

Logging

🌍 Diffusers has a centralized logging system to easily manage the verbosity of the library. The default verbosity is set to WARNING.

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

Copied

import diffusers

diffusers.logging.set_verbosity_info()

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:

Copied

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 disables any warning logged by logger.warning_advice. For example:

Copied

DIFFUSERS_NO_ADVISORY_WARNINGS=1 ./myprogram.py

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

Copied

from diffusers.utils import logging

logging.set_verbosity_info()
logger = logging.get_logger("diffusers")
logger.info("INFO")
logger.warning("WARN")

In order from the least verbose to the most verbose:

Method
Integer value
Description

diffusers.logging.CRITICAL or diffusers.logging.FATAL

50

only report the most critical errors

diffusers.logging.ERROR

40

only report errors

diffusers.logging.WARNING or diffusers.logging.WARN

30

only report errors and warnings (default)

diffusers.logging.INFO

20

only report errors, warnings, and basic information

diffusers.logging.DEBUG

10

report all information

Base setters

diffusers.utils.logging.set_verbosity_error

( )

Set the verbosity to the ERROR level.

diffusers.utils.logging.set_verbosity_warning

( )

Set the verbosity to the WARNING level.

diffusers.utils.logging.set_verbosity_info

( )

Set the verbosity to the INFO level.

diffusers.utils.logging.set_verbosity_debug

( )

Set the verbosity to the DEBUG level.

Other functions

diffusers.utils.logging.get_verbosity

( ) → int

Returns

int

Logging level integers which can be one of:

  • 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

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

diffusers.utils.logging.set_verbosity

( verbosity: int )

Parameters

  • verbosity (int) — Logging level which can be 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.

diffusers.utils.get_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.

diffusers.utils.logging.enable_default_handler

( )

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

diffusers.utils.logging.disable_default_handler

( )

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

diffusers.utils.logging.enable_explicit_format

( )

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

Copied

[LEVELNAME|FILENAME|LINE NUMBER] TIME >> MESSAGE

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

diffusers.utils.logging.reset_format

( )

Resets the formatting for 🌍 Diffusers’ loggers.

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

diffusers.utils.logging.enable_progress_bar

( )

Enable tqdm progress bar.

diffusers.utils.logging.disable_progress_bar

( )

Disable tqdm progress bar.

PreviousDiffusion PipelineNextConfiguration

Last updated 1 year ago

All methods of the logging module are documented below. The main methods are to get the current level of verbosity in the logger and to set the verbosity to the level of your choice.

By default, tqdm progress bars are displayed during model download. and are used to enable or disable this behavior.

🌍
🌍
logging.get_verbosity()
logging.set_verbosity()
logging.disable_progress_bar()
logging.enable_progress_bar()
<source>
<source>
<source>
<source>
<source>
<source>
<source>
<source>
<source>
<source>
<source>
<source>
<source>