AI Art Generation with Stable Diffusion

How Stable Diffusion turns a prompt into an image, how SDXL differs from SD 1.5, the VRAM you need locally, and what licences and lawsuits mean for…

AI Art Generation with Stable Diffusion
Written by TechnoLynx Published on 31 Oct 2023

Stable Diffusion is a latent diffusion model for text-to-image generation, built by researchers and engineers from CompVis and Stability AI, and its code and weights are public. For AI art that matters for practical reasons. You can run the same model on your own GPU and fine-tune it. Stable Diffusion does not work on pixels directly. It starts from noise in a compressed latent space, removes that noise step by step under the guidance of your prompt, and then decodes the result into an image.

How Stable Diffusion Turns a Text Prompt into an Image

Stable Diffusion has three parts: a variational autoencoder (VAE), a U-Net, and a text encoder.

  1. Compress. In training, the VAE encoder maps an image from pixel space into a smaller latent space. In standard Stable Diffusion training, NVIDIA’s NeMo documentation describes a 512x512x3 image being condensed to 64x64x4. That is a downsampling factor of 8 on each side, as the v1-4 model card states.
  2. Encode the prompt. A transformer text encoder, CLIP ViT-L/14 in version 1, turns the prompt into embeddings.
  3. Denoise. Generation starts from random noise in latent space. The U-Net predicts the noise at each timestep, conditioned on the timestep and the text embedding, and the loop runs for the configured number of steps. The text embedding reaches the U-Net through cross-attention layers.
  4. Decode. The VAE decoder converts the denoised latent back into a full-resolution image.

The reason for working in latent space comes from the original latent diffusion paper. Rombach and colleagues (CVPR 2022) argued that training diffusion models in the latent space of a pretrained autoencoder reaches a near-optimal point between complexity reduction and detail preservation, and that cross-attention turns diffusion models into flexible generators for conditioning inputs such as text. The Hugging Face Diffusers documentation puts the practical result plainly: diffusion over a lower-dimensional latent space reduces memory and compute. If you want the general diffusion idea before the Stable Diffusion specifics, our explainer on how AI image generators and the diffusion process work covers it.

The same machinery also runs img2img, which takes an existing image, a prompt and a strength value between 0 and 1. Higher strength adds more noise, so the output varies more and may drift from the prompt. For artists this is often the more useful mode, because the composition comes from their own input image rather than from noise.

Stable Diffusion XL Compared with SD 1.5 and SD 2

Stable Diffusion XL keeps the same latent diffusion architecture and scales it up. It has a larger U-Net, a larger cross-attention context, two text encoders instead of one, and training on several aspect ratios instead of squares only. The SDXL paper (Podell et al., 2023) describes the U-Net as three times larger, with most of the extra parameters in more attention blocks and the larger cross-attention context that the second text encoder requires. SDXL also has a refiner model, released at the same time. The base model produces latents, and the refiner handles the final denoising steps using an img2img technique (SDEdit) with the same prompt. The base model also works on its own.

  SD 1.x SD 2.x SDXL 1.0
Text encoder CLIP ViT-L/14, frozen OpenCLIP, developed by LAION Two fixed encoders, including OpenCLIP-ViT/G
Size 860M U-Net plus 123M text encoder 865M parameters (GigaGPU’s table) 3.5B base, 6.6B with refiner
Native resolution 512x512 training images 512x512 and 768x768 1024x1024, several aspect ratios
Extra pipelines img2img Inpainting, 4x upscaler, depth-to-image Refiner stage

Stability AI says SDXL 1.0 does better on hands, text and spatially arranged compositions, and the survey by Zhang et al. links the larger U-Net to better faces and aesthetics. Those are the developer’s and the literature’s claims. In GigaGPU’s benchmark (a GPU hosting provider testing on its own servers at native resolution with 20 steps), SDXL was 3.2 to 3.4 times slower than SD 1.5 on every GPU it tested. GigaGPU explains the gap by SDXL having roughly 3.5 times the U-Net parameters and generating four times the pixels. The pixel figure follows from the resolutions: 1024x1024 has four times the pixels of 512x512.

Stable Diffusion 3 is built on a diffusion transformer architecture. It uses a Multimodal Diffusion Transformer with separate weights for image and text, which Stability AI says improves text understanding and spelling. See our overview of the latest advancements in AI image generation.

What Hardware Do You Need to Run Stable Diffusion Locally?

For SD 1.5, GigaGPU puts the need at about 4 GB of VRAM. Wikipedia notes that an optimised build of the original model runs on GPUs with as little as 2.4 GB. SDXL needs more: about 6.5 GB at FP16 in GigaGPU’s table, 10.5 GB in its benchmark, and 8 GB per Stability AI.

Treat every VRAM figure here as dependent on settings. The per-precision breakdown below comes from GigaGPU, so it is one vendor’s measurement and not a universal result. Its peak VRAM figures, at 1024x1024 for SDXL and 512x512 for SD 1.5 and 2.1:

Model Parameters FP32 FP16 FP8 NF4
SD 1.5 860M ~6 GB ~3.5 GB ~2.5 GB ~2 GB
SD 2.1 865M ~6.5 GB ~3.8 GB ~2.8 GB ~2.2 GB
SDXL Base 3.5B ~16 GB ~6.5 GB ~4.5 GB ~3.5 GB
SDXL Base + Refiner (loaded one after the other) 6.6B ~28 GB ~7.5 GB ~5 GB ~4 GB

GigaGPU’s own pages give different SDXL figures. We read the gap as a difference in settings, not a contradiction about the model. That is why a single “minimum VRAM” number misleads. Memory depends on precision, resolution, batch size, and on whether the refiner and text encoders stay resident. GigaGPU also notes that VRAM rises roughly with pixel count, which quadruples when you double the resolution, and that the VAE decode creates a separate memory peak after denoising.

At the top end, Stability AI reports that its largest SD3 model, with 8B parameters, fits in the 24 GB of an RTX 4090 and took 34 seconds per 1024x1024 image at 50 steps in early, unoptimised tests. Dropping SD3’s 4.7B-parameter T5 text encoder at inference cuts memory considerably. The cost is slightly weaker prompt adherence and a larger drop in typography.

Comparing GPUs for a purchase is a measurement question, and it is better answered with published, reproducible benchmark data than with vendor blog tables.

Common Local Failures and the Levers That Fix Them

  • The GPU is never used. A PyTorch build without CUDA support runs the whole pipeline on the CPU. That is slow enough to look like a hang, so check torch.cuda.is_available() before blaming the model.
  • Out of memory on a small card. The v1-4 model card advises loading in float16 instead of the default float32 when you have less than 4 GB of GPU memory.
  • SDXL does not fit. The SDXL model card suggests pipe.enable_model_cpu_offload() in place of .to("cuda"). Model offloading keeps one main component, such as the U-Net, on the GPU at a time. Per-submodule CPU offloading saves more memory but Diffusers itself describes it as extremely slow and often impractical.
  • The VAE decode runs out of memory at high resolution or in batches. VAE slicing decodes one image of a batch at a time, and VAE tiling decodes overlapping tiles. Tiling can leave slight tone variation between tiles. Diffusers also supports memory-efficient attention backends such as FlashAttention and xFormers.

Where Does AI Art Generation Sit Between Adobe, Playground and an Engineering Pipeline?

A consumer tool is the right choice when the person is the pipeline: someone curating a small number of images, for whom setup time costs more than control. Stable Diffusion in your own pipeline earns its place when you need any of four things:

  • A fixed model version and seed, so that results can be reproduced
  • Generation on your own infrastructure
  • Throughput at a known cost, where batch size matters. GigaGPU, for example, puts eight SD 1.5 images on a 24 GB GPU against one or two for the much larger Flux.1
  • Control over the pipeline stages: running the SDXL base without the refiner, swapping the text encoder strategy, or adding img2img and inpainting steps

At one end of the range are hosted creative tools, where a person writes a prompt and picks results. At the other end is an engineering pipeline, where the model runs as one component at volume. Because its code and weights are public, Stable Diffusion can run in your own pipeline as well as inside creative tools. The model has already been built into existing creative software: a “Stability” plugin brings its image generation into Photoshop, alongside Adobe’s own AI features such as Context-Aware Fill. For a closer look at the hosted end, our piece on where Playground AI fits in production image pipelines covers how a consumer tool behaves once real workloads arrive.

Once the image model has retrieval, agents or evaluation around it, the work becomes generative and agentic AI R&D rather than tool selection.

Can You Legally Sell Art Made with Stable Diffusion?

Under the model licences, as between you and the developer, you own and may sell what you generate. Owning the output under a licence is not holding copyright in it, though, and the US artists’ lawsuit survived the motion to dismiss in part. These are three separate questions, and each has its own answer.

What the Model Licence Allows

The licence settles ownership as between you and the model’s developer. Wikipedia summarises the OpenRAIL-M position: the user owns the rights to generated images and may use them commercially. The SDXL licence (CreativeML Open RAIL++-M, dated 26 July 2023) states that the licensor claims no rights in the output. It also makes you accountable for the output and its uses, and it lists use-based restrictions in Attachment A. The RAIL initiative explains that OpenRAIL licences allow commercial use while keeping usage restrictions, and that those restrictions carry over to derivatives such as fine-tunes.

Newer models use different terms. Stable Diffusion 3.5 is under the Stability AI Community License. That licence allows commercial use for individuals and organisations with less than USD 1M in annual revenue, from any source. Above that threshold, commercial use requires an Enterprise License. Stability AI’s licence page confirms that you own outputs from its Core Models and their fine-tunes, subject to applicable law and its acceptable use policy.

Whether Anyone Else Can Copy Your Image

Copyright decides whether you can stop someone else from reusing your image, and in the US it requires human authorship. The US Copyright Office (January 2025 report) concluded that, with current technology, prompts alone do not give enough human control to make the user the author of the output. In the Office’s view, revising and resubmitting prompts many times does not change that, because it only produces more outputs to choose from. The Office applied this in its decision on Zarya of the Dawn. It cancelled the original registration and re-registered only the human-written text and the selection and arrangement of text and images, excluding the Midjourney-generated artwork.

There is still a route to protection. The Office holds that copyright covers human expression that is perceptible in an AI output, as well as creative selection, arrangement or modification of that output. Our reading is that an image built from your own sketch through img2img and then substantially edited stands on firmer ground than a prompt-only render. The answer also varies by country: the Office’s report notes a Chinese court that protected a Stable Diffusion image on the strength of more than 150 prompts plus later adjustments. In practice, then, you can sell a prompt-only image, but you may not be able to stop others copying it. If exclusivity matters to the buyer, settle that with a lawyer in the relevant jurisdiction before signing.

Where the Litigation Stands

The lawsuits target the model developers’ training and distribution of the models. In January 2023, artists Sarah Andersen, Kelly McKernan and Karla Ortiz sued Stability AI, Midjourney and DeviantArt in the Northern District of California. On 12 August 2024 the court dismissed the DMCA section 1202 claims with prejudice. It let the trademark, direct copyright infringement and inducement claims proceed. Judge Orrick said the inducement question “depends on how Stable Diffusion works” and should be decided after discovery. He also held that works stored as algorithmic or mathematical representations inside the model did not defeat the claim at that stage. Getty Images sued Stability AI in the English High Court in January 2023 and, on 4 November 2025, largely lost the case.

An image that closely resembles a specific training image is a risk whatever the licence says. The v1-4 model card itself notes some memorisation of images that were duplicated in the training data. For the artists’ side of this debate, see how AI tools are changing the way we create art.

FAQ

Is Stable Diffusion Still Good?

It has run from 1.4 and 1.5 through 2.0, 2.1, XL and 3. Stability AI reports that SD3 beat DALL·E 3, Midjourney v6 and Ideogram v1 on typography and prompt adherence in human preference evaluations, though that is the developer’s own claim.

What Were Stable Diffusion’s Models Trained On?

They were trained on image-caption pairs from LAION-5B, a public dataset derived from Common Crawl web data. SD 2 used an aesthetic subset of that data, filtered with LAION’s NSFW filter to remove adult content.