Views
No views yet

@InProceedings{Rombach_2022_CVPR,
author = {Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj\"orn},
title = {High-Resolution Image Synthesis With Latent Diffusion Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022},
pages = {10684-10695}
}pip install --upgrade git+https://github.com/huggingface/diffusers.git transformers accelerate scipy1from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
2import torch
3
4model_id = "aipicasso/cool-japan-diffusion-2-1-0-beta"
5
6scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
7pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
8pipe = pipe.to("cuda")
9
10prompt = "anime, a portrait of a girl with black short hair and red eyes, kimono, full color illustration, official art, 4k, detailed"
11negative_prompt="low quality, bad face, bad anatomy, bad hand, lowres, jpeg artifacts, 2d, 3d, cg, text"
12image = pipe(prompt,negative_prompt=negative_prompt).images[0]
13
14image.save("girl.png")
15pipe.enable_attention_slicing() を使ってください。@InProceedings{Rombach_2022_CVPR,
author = {Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj\"orn},
title = {High-Resolution Image Synthesis With Latent Diffusion Models},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2022},
pages = {10684-10695}
}