Parti Prompts

Exploring Parti Prompts

txt2img
Published

February 19, 2024

Stable Cascade

SDXL

SDXL images were generated with 25 steps using the FP16 variant

from diffusers import StableDiffusionXLPipeline
import torch

pipeline = StableDiffusionXLPipeline.from_pretrained(
  "stabilityai/stable-diffusion-xl-base-1.0",
  torch_dtype=torch.float16,
  variant="fp16",
  use_safetensors=True,
  add_watermarker=False,
).to(DEVICE)

image = pipeline(prompt, 
    generator=torch.Generator("cuda").manual_seed(seed),
    num_inference_steps=25).images[0]

image.save("output.jpg")

SDXL Turbo

SDXL Turbo were generated with the diffuser defaults / guidance_scale of 0 / num_inference_steps = 1


from diffusers import AutoPipelineForText2Image, AutoPipelineForImage2Image
import torch


pipeline = AutoPipelineForText2Image.from_pretrained(
  "stabilityai/sdxl-turbo", torch_dtype=torch.float16, variant="fp16"
).to(DEVICE)

torch.manual_seed(seed)

with torch.no_grad():
    image = pipeline(
        prompt=prompt,
        guidance_scale=0.0,
        num_inference_steps=1
    ).images[0]

    image.save("output.jpg")