Open16

stable diffusion xl + wrong Loraを使う

ShuzoNShuzoN

Stable Diffusion 2.1 (v2-1_768-ema-pruned.ckpt)

をckptをダウンロード

ShuzoNShuzoN

利用モデルをプルダウンから選ぶ。こんな感じで画像生成されていく

ShuzoNShuzoN
A woman with an umbrella walks along a street surrounded by New York City buildings. Numerous yellow taxis crisscross the street in the rain.
Drawing only Asians, avoiding Caucasians and African Americans.

DPM++ 2M Karras

ShuzoNShuzoN

100コンピューティングリソースを購入。(1100円)

v100 gpu利用するのでcudeで実行してみる

from diffusers import DiffusionPipeline
import torch

pipe = DiffusionPipeline.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    torch_dtype=torch.float16,
    use_safetensors=True,
    variant="fp16"
    )
pipe.to("cuda")
ShuzoNShuzoN
# 画像生成の実行
prompt = "cute cat ear maid"
image = pipe(prompt=prompt).images[0]

# 保存と表示
image.save("output.png")
image

いい感じの仕上がり

ShuzoNShuzoN

out of memoryしたw

OutOfMemoryError: CUDA out of memory. Tried to allocate 512.00 MiB (GPU 0; 15.77 GiB total capacity; 12.83 GiB already allocated; 484.12 MiB free; 13.81 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF```
ShuzoNShuzoN
# 画像生成の実行
prompt = "A woman with an umbrella walks along a street surrounded by New York City buildings. Numerous yellow taxis crisscross the street in the rain."
image = pipe(prompt=prompt).images[0]

# 保存と表示
image.save("output.png")
image

refineを入れて雨の女を描く。だいぶすごい

ShuzoNShuzoN

同じプロンプトでmid journey

A woman with an umbrella walks along a street surrounded by New York City buildings. Numerous yellow taxis crisscross the street in the rain. --v 5.2

ShuzoNShuzoN

VRAM足りずにハングアップするな

ShuzoNShuzoN

t4 gpuにして、cude使ったら動いた。

質がすごすぎる