Shortcuts

mmedit.models.editors.disco_diffusion.secondary_model

Module Contents

Classes

ConvBlock

Convolution Block.

SkipBlock

Skip block wrapper. Wrapping main block and skip block and concat their

FourierFeatures

Fourier features mapping MLP.

SecondaryDiffusionImageNet2

A smaller secondary diffusion model trained by Katherine Crowson to

Functions

append_dims(x, n)

Append dims.

expand_to_planes(x, shape)

Expand tensor to planes.

alpha_sigma_to_t(alpha, sigma)

convert alpha&sigma to timestep.

t_to_alpha_sigma(t)

convert timestep to alpha and sigma.

mmedit.models.editors.disco_diffusion.secondary_model.append_dims(x, n)[source]

Append dims.

mmedit.models.editors.disco_diffusion.secondary_model.expand_to_planes(x, shape)[source]

Expand tensor to planes.

mmedit.models.editors.disco_diffusion.secondary_model.alpha_sigma_to_t(alpha, sigma)[source]

convert alpha&sigma to timestep.

mmedit.models.editors.disco_diffusion.secondary_model.t_to_alpha_sigma(t)[source]

convert timestep to alpha and sigma.

class mmedit.models.editors.disco_diffusion.secondary_model.ConvBlock(c_in, c_out)[source]

Bases: torch.nn.Sequential

Convolution Block.

Parameters
  • c_in (int) – Input channels.

  • c_out (int) – Output channels.

class mmedit.models.editors.disco_diffusion.secondary_model.SkipBlock(main, skip=None)[source]

Bases: torch.nn.Module

Skip block wrapper. Wrapping main block and skip block and concat their outputs together.

Parameters
  • main (list) – A list of main modules.

  • skip (nn.Module) – Skip Module. If not given, set to nn.Identity(). Defaults to None.

forward(input)[source]

Forward function.

class mmedit.models.editors.disco_diffusion.secondary_model.FourierFeatures(in_features, out_features, std=1.0)[source]

Bases: torch.nn.Module

Fourier features mapping MLP.

Parameters
  • in_features (int) – Input channels.

  • out_features (int) – Output channels.

  • std (float) – Standard deviation. Defaults to 1..

forward(input)[source]

Forward function.

class mmedit.models.editors.disco_diffusion.secondary_model.SecondaryDiffusionImageNet2[source]

Bases: torch.nn.Module

A smaller secondary diffusion model trained by Katherine Crowson to remove noise from intermediate timesteps to prepare them for CLIP.

Ref: https://twitter.com/rivershavewings/status/1462859669454536711 # noqa

forward(input, t)[source]

Forward function.

Read the Docs v: latest
Versions
master
latest
stable
zyh-re-docs
zyh-doc-notfound-extend
zyh-api-rendering
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.