Model reference · open weights

sd-image-variations

Available as managed deployment Image lambda Image edit 1 variants 2k dl/mo

sd-image-variations is an open-weight image model from lambda. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.

Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.

What it is

Released bylambda
TypeImage models
TaskImage edit
Runs withdiffusers
Released2022-09-09
Popularity2k downloads / month
LicenceOpen weights

About

What sd-image-variations is

📣 V2 model released, and blurriness issues fixed! 📣

🧨🎉 Image Variations is now natively supported in 🤗 Diffusers! 🎉🧨

Read the full model card

Version 2

This version of Stable Diffusion has been fine tuned from CompVis/stable-diffusion-v1-4-original to accept CLIP image embedding rather than text embeddings. This allows the creation of "image variations" similar to DALLE-2 using Stable Diffusion. This version of the weights has been ported to huggingface Diffusers, to use this with the Diffusers library requires the Lambda Diffusers repo.

This model was trained in two stages and longer than the original variations model and gives better image quality and better CLIP rated similarity compared to the original version

See training details and v1 vs v2 comparison below.

Example

Make sure you are using a version of Diffusers >=0.8.0 (for older version see the old instructions at the bottom of this model card)

from diffusers import StableDiffusionImageVariationPipeline
from PIL import Image

device = "cuda:0"
sd_pipe = StableDiffusionImageVariationPipeline.from_pretrained(
  "lambdalabs/sd-image-variations-diffusers",
  revision="v2.0",
  )
sd_pipe = sd_pipe.to(device)

im = Image.open("path/to/image.jpg")
tform = transforms.Compose([
    transforms.ToTensor(),
    transforms.Resize(
        (224, 224),
        interpolation=transforms.InterpolationMode.BICUBIC,
        antialias=False,
        ),
    transforms.Normalize(
      [0.48145466, 0.4578275, 0.40821073],
      [0.26862954, 0.26130258, 0.27577711]),
])
inp = tform(im).to(device).unsqueeze(0)

out = sd_pipe(inp, guidance_scale=3)
out["images"][0].save("result.jpg")

The importance of resizing correctly... (or not)

Note that due a bit of an oversight during training, the model expects resized images without anti-aliasing. This turns out to make a big difference and is important to do the resizing the same way during inference. When passing a PIL image to the Diffusers pipeline antialiasing will be applied during resize, so it's better to input a tensor which you have prepared manually according to the transfrom in the example above!

Here are examples of images generated without (top) and with (bottom) anti-aliasing during resize. (Input is this image)

V1 vs V2

Here's an example of V1 vs V2, version two was trained more carefully and for longer, see the details below. V2-top vs V1-bottom

Input images:

One important thing to note is that due to the longer training V2 appears to have memorised some common images from the training data, e.g. now the previous example of the Girl with a Pearl Earring almosts perfectly reproduce the original rather than creating variations. You can always use v1 by specifiying revision="v1.0".

v2 output for girl with a pearl earing as input (guidance scale=3)

Training

Training Procedure This model is fine tuned from Stable Diffusion v1-3 where the text encoder has been replaced with an image encoder. The training procedure is the same as for Stable Diffusion except for the fact that images are encoded through a ViT-L/14 image-encoder including the final projection layer to the CLIP shared embedding space. The model was trained on LAION improved aesthetics 6plus.

  • Hardware: 8 x A100-40GB GPUs (provided by Lambda GPU Cloud)

  • Optimizer: AdamW

  • Stage 1 - Fine tune only CrossAttention layer weights from Stable Diffusion v1.4 model

    • Steps: 46,000
    • Batch: batch size=4, GPUs=8, Gradient Accumulations=4. Total batch size=128
    • Learning rate: warmup to 1e-5 for 10,000 steps and then kept constant
  • Stage 2 - Resume from Stage 1 training the whole unet

    • Steps: 50,000
    • Batch: batch size=4, GPUs=8, Gradient Accumulations=5. Total batch size=160
    • Learning rate: warmup to 1e-5 for 5,000 steps and then kept constant

Training was done using a modified version of the original Stable Diffusion training code.

Uses

The following section is adapted from the Stable Diffusion model card

Direct Use

The model is intended for research purposes only. Possible research areas and tasks include

  • Safe deployment of models which have the potential to generate harmful content.
  • Probing and understanding the limitations and biases of generative models.
  • Generation of artworks and use in design and other artistic processes.
  • Applications in educational or creative tools.
  • Research on generative models.

Excluded uses are described below.

Misuse, Malicious Use, and Out-of-Scope Use

The model should not be used to intentionally create or disseminate images that create hostile or alienating environments for people. This includes generating images that people would foreseeably find disturbing, distressing, or offensive; or content that propagates historical or current stereotypes.

Out-of-Scope Use

The model was not trained to be factual or true representations of people or events, and therefore using the model to generate such content is out-of-scope for the abilities of this model.

Misuse and Malicious Use

Using the model to generate content that is cruel to individuals is a misuse of this model. This includes, but is not limited to:

  • Generating demeaning, dehumanizing, or otherwise harmful representations of people or their environments, cultures, religions, etc.
  • Intentionally promoting or propagating discriminatory content or harmful stereotypes.
  • Impersonating individuals without their consent.
  • Sexual content without consent of the people who might see it.
  • Mis- and disinformation
  • Representations of egregious violence and gore
  • Sharing of copyrighted or licensed mat

From the published model card. Full card on the HuggingFace links in the sidebar.

How it works

How image models work

Text promptwhat to makeText encoderunderstands itDiffusion stepsdenoise to pixelsImagePNG / JPEGA diffusion model starts from noise and denoises it, guided by your prompt, into a finished image.

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys sd-image-variations for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (sd-image-variations below is illustrative; you get the exact model name on deployment.)

$ curl -sS https://api.axforge.ai/v1/images/generations \
  -H "Authorization: Bearer $AXFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"sd-image-variations","prompt":"a red bicycle","size":"1024x1024"}'

Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms