Last active
September 7, 2022 01:08
-
-
Save esmarkowski/2555261a5f50f723cb71163a09f1c89c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch import autocast | |
from diffusers import StableDiffusionPipeline | |
model_id = "CompVis/stable-diffusion-v1-4" | |
device = "cuda" | |
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True) | |
pipe = pipe.to(device) | |
prompt = " ".join([subject, setting, style]) | |
with autocast("cuda"): | |
image = pipe(prompt, guidance_scale=7.5)["sample"][0] | |
image.save( prompt + ".png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment