Skip to main content
Hugging Face Diffusers is the go-to library for state-of-the-art pre-trained diffusion models for generating images, audio, and even 3D structures of molecules. The W&B integration adds rich, flexible experiment tracking, media visualization, pipeline architecture, and configuration management to interactive centralized dashboards without compromising that ease of use.

Next-level logging in just two lines

Log all the prompts, negative prompts, generated media, and configs associated with your experiment by simply including 2 lines of code. Here are the 2 lines of code to begin logging:
Experiment results logging

Get started

  1. Install diffusers, transformers, accelerate, and wandb.
    • Command line:
    • Notebook:
  2. Use autolog to initialize a W&B Run and automatically track the inputs and the outputs from all supported pipeline calls. You can call the autolog() function with the init parameter, which accepts a dictionary of parameters required by wandb.init(). When you call autolog(), it initializes a W&B Run and automatically tracks the inputs and the outputs from all supported pipeline calls.
    • Each pipeline call is tracked into its own table in the workspace, and the configs associated with the pipeline call is appended to the list of workflows in the configs for that run.
    • The prompts, negative prompts, and the generated media are logged in a wandb.Table.
    • All other configs associated with the experiment including seed and the pipeline architecture are stored in the config section for the run.
    • The generated media for each pipeline call are also logged in media panels in the run.
    You can find a list of supported pipeline calls. In case, you want to request a new feature of this integration or report a bug associated with it, open an issue on the W&B GitHub issues page.

Examples

Autologging

Here is a brief end-to-end example of the autolog in action:
  • The results of a single experiment:
    Experiment results logging
  • The results of multiple experiments:
    Experiment results logging
  • The config of an experiment:
    Experiment config logging
You need to explicitly call wandb.Run.finish() when executing the code in IPython notebook environments after calling the pipeline. This is not necessary when executing python scripts.

Tracking multi-pipeline workflows

This section demonstrates the autolog with a typical Stable Diffusion XL + Refiner workflow, in which the latents generated by the StableDiffusionXLPipeline is refined by the corresponding refiner.
  • Example of a Stable Diffisuion XL + Refiner experiment:
    Stable Diffusion XL experiment tracking

More resources