Open16
stable diffusion xl + wrong Loraを使う
brew install cmake protobuf rust python@3.10 git wget
Stable Diffusion 2.1 (v2-1_768-ema-pruned.ckpt)
をckptをダウンロード

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

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
google colabでsdxlを動かす
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")
# 画像生成の実行
prompt = "cute cat ear maid"
image = pipe(prompt=prompt).images[0]
# 保存と表示
image.save("output.png")
image
いい感じの仕上がり


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```# 画像生成の実行
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を入れて雨の女を描く。だいぶすごい

同じプロンプトで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

loraをくっつけてみる
以下を参考に
あんまりうまくいかなかったのでhugging faceの wrong loraのジュピターノートブックを再利用

VRAM足りずにハングアップするな
t4 gpuにして、cude使ったら動いた。
質がすごすぎる
