1from diffusers import StableDiffusionPipeline
2import torch
3
4# Set device
5device = (
6 "mps"
7 if torch.backends.mps.is_available()
8 else "cuda"
9 if torch.cuda.is_available()
10 else "cpu"
11)
12torch_dtype = torch.float16 if device == "cuda" else torch.float32
13pipeline = StableDiffusionPipeline.from_pretrained("jangmin/foodai-pipeline-ko", torch_dtype=torch_dtype)
14pipeline.to(device)
15
16prompt = "짜장면, 정면에서 본 사진, 그릇에 담긴"
17image = pipeline(prompt, guidance_scale=8, num_inference_steps=35).images[0]
18image