Notes for Stable Diffusion


Hugging Face Stable Diffusion Google Colab Custom Code


Single Image Output

for quick prompt itearation

from torch import autocast
prompt = "a high altitude shot of mount fuji, beautiful sunset, insane level of detail, by Ivan Aivazovsky, James Gurney & James Paick, trending on artstation"#@param{type:"string"}
cfg = 15#@param{type:"number"}
eta = 0.75#@param{type:"number"}
height = 512#@param{type:"number"}
width = 1024#@param{type:"number"}
steps = 50#@param{type:"number"}
seed = 8913213#@param{type:"number"}

generator = torch.Generator("cuda").manual_seed(seed)

with autocast("cuda"):
  image = pipe(prompt, height=height, width=width, strength=eta, guidance_scale=cfg, num_inference_steps=steps, generator=generator)["sample"][0]
image

Resolution


512 576 640 704 768 832 896 960 1024

Testing


Sampler