Skip to content
fn

rectified_flow_cifar_gen

→RectifiedFlowForImageGeneration
rectified_flow_cifar_gen(pretrained: bool = False, overrides: object = {})

Rectified Flow generator for CIFAR-10 32 x 32.

Same field as rectified_flow_cifar, wrapped with the objective, RectifiedFlowForImageGeneration.reflow_pairs and the sampler.

Model Size

Parameters

pretrainedbool= False
No checkpoint is published for rectified_flow_cifar_gen, so True raises NotImplementedError rather than return randomly initialised weights.
**overridesobject= {}
Optional RectifiedFlowConfig field overrides. Pass t_schedule="t0" to build the one-step distillation stage.

Returns

RectifiedFlowForImageGeneration

Generator configured for CIFAR-10.

Notes

Reference: Liu, Gong, and Liu, "Flow Straight and Fast", ICLR, 2023 (arXiv:2209.03003). Reported: 4.85 FID at one function evaluation.

Examples

>>> from lucid.models.generative.rectified_flow import rectified_flow_cifar_gen
>>> model = rectified_flow_cifar_gen(sample_size=8, base_channels=16,
...                                  channel_mult=(1, 2), num_res_blocks=1,
...                                  attention_resolutions=()).eval()
>>> z0, z1 = model.reflow_pairs(n_samples=2, steps=4)
>>> model(z1, noise=z0).loss.shape          # the reflow objective
()

Used by 1