Automatic Integration with 🤗 Diffusers 🧨
This function automatically integrates Weights & Biases logging by inferring the necessary callback for the Diffusion Pipeline.
get_wandb_callback(pipeline, prompt, wandb_project, num_inference_steps=None, num_images_per_prompt=None, wandb_entity=None, weave_mode=False, negative_prompt=None, configs={}, **kwargs)
A function for automatically inferring the W&B callback for the respective
DiffusionPipeline
.
Warning
While using this function to automatically infer the type of the
DiffusionPipeline
, we must ensure to explicitly set the parameters of
the respective callback exclusive to that particular callback, for example,
in order to use the StableDiffusionCallback
we must explicitly pass the
guidance_scale
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline |
DiffusionPipeline
|
The |
required |
prompt |
Union[str, List[str]]
|
The prompt or prompts to guide the image generation. |
required |
wandb_project |
Optional[str]
|
The name of the project where you're sending the new run. The project is not necessary to be specified unless the run has automatically been initiatlized before the callback is defined. |
required |
wandb_entity |
Optional[str]
|
An entity is a username or team name where you're sending runs. This entity must exist before you can send runs there, so make sure to create your account or team in the UI before starting to log runs. If you don't specify an entity, the run will be sent to your default entity, which is usually your username. Change your default entity in your settings under "default location to create new projects". |
None
|
weave_mode |
bool
|
Whether to use log to a
weave board instead of W&B dashboard or
not. The weave mode logs the configs, generated images and timestamp in a
|
False
|
num_inference_steps |
Optional[int]
|
The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference. |
None
|
num_images_per_prompt |
Optional[int]
|
The number of images to generate per prompt. |
None
|
negative_prompt |
Optional[Union[str, List[str]]]
|
The prompt or prompts not
to guide the image generation. Ignored when not using guidance
(i.e., ignored if |
None
|
configs |
Optional[Dict]
|
Additional configs for the experiment you want to sync, for example, seed could be a good config to be passed here. |
{}
|