Skip to content

Commit

Permalink
stable diffusion experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
manufy committed May 31, 2024
1 parent eee8477 commit 9948999
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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",
cache_dir="./custom_cache")
#∫pipe.to("cuda")

# if using torch < 2.0
# pipe.enable_xformers_memory_efficient_attention()

prompt = "An astronaut riding a green horse"

images = pipe(prompt=prompt).images[0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from diffusers import DiffusionPipeline


pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", cache_dir="./custom_cache")

prompt = "An astronaut riding a green horse"

images = pipeline(prompt=prompt).images[0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
diffusers
invisible_watermark
transformers
accelerate
safetensors

0 comments on commit 9948999

Please sign in to comment.