Skip to content

Instantly share code, notes, and snippets.

@noskill
Last active November 10, 2023 19:22
Show Gist options
  • Save noskill/702a75de92390c576bf3db3ee2c425cb to your computer and use it in GitHub Desktop.
Save noskill/702a75de92390c576bf3db3ee2c425cb to your computer and use it in GitHub Desktop.
import os
from diffusers import StableDiffusionPipeline
import torch
model_id = "dreamlike-art/dreamlike-photoreal-2.0"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "photo, a church in the middle of a field of crops, bright cinematic lighting, gopro, fisheye lens"
image = pipe(prompt).images[0]
image.save("./result.jpg")
print(f'saved image to {os.getcwd()}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment