Last active
October 24, 2022 07:30
-
-
Save wfng92/f5a4e8f6faf9a622513e3cc222fb49bd 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
from ldm.generate import Generate | |
# model configuration | |
gr = Generate( | |
'stable-diffusion-1.4', | |
embedding_path='./models/embeddings.pt' # modify the embedding path | |
) | |
# model loading | |
gr.load_model() | |
# variable initialization | |
text = "a photo of *" | |
# inference returns a list of tuple | |
results = gr.prompt2image( | |
prompt = text, | |
outdir = "./outputs/", | |
iterations=1, | |
steps=50 | |
) | |
# save the image in outputs folder | |
for row in results: | |
im = row[0] | |
seed = row[1] | |
im.save(f'./outputs/image-{seed}.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment