Skip to content

Instantly share code, notes, and snippets.

@noskill
Created November 7, 2023 08:19
Show Gist options
  • Save noskill/1d4554812968a0cf4f34f89d197c0cc6 to your computer and use it in GitHub Desktop.
Save noskill/1d4554812968a0cf4f34f89d197c0cc6 to your computer and use it in GitHub Desktop.
hello world in diffusers
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("hf-internal-testing/tiny-stable-diffusion-torch")
prompt = "a photo of an astronaut riding a horse on mars"
pipe.enable_attention_slicing()
image = pipe(prompt).images[0]
print(image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment