import torch
from diffusers import StableDiffusionPipeline

# モデルのフォルダーのパス
model = "./stable-diffusion-v1-5"

# パイプラインを作成
pipeline = StableDiffusionPipeline.from_pretrained(model)

# GPUを使う場合は"cuda"。使わない場合は"cpu"
pipeline = pipeline.to("cuda")

# ポジティブプロンプトとネガティブプロンプト
prompt = "Nature and waterfall illustration."
negative_prompt = "low quality, blurry"

# 画像を生成
response = pipeline(prompt=prompt, negative_prompt=negative_prompt)
image = response.images[0]
image.save("image.png")
