KorAI commited on
Commit
01ec0b0
·
verified ·
1 Parent(s): de31462

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -0
README.md CHANGED
@@ -37,6 +37,39 @@ Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.
37
 
38
  ```python
39
  # TODO: add an example code snippet for running this diffusion pipeline
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  ```
41
 
42
  #### Limitations and bias
 
37
 
38
  ```python
39
  # TODO: add an example code snippet for running this diffusion pipeline
40
+ from diffusers import DiffusionPipeline
41
+ import torch
42
+
43
+ # Load Stable Diffusion XL Base1.0
44
+ pipe = DiffusionPipeline.from_pretrained(
45
+ "stabilityai/stable-diffusion-xl-base-1.0",
46
+ torch_dtype=torch.float16,
47
+ variant="fp16",
48
+ use_safetensors=True
49
+ ).to("cuda")
50
+
51
+ # Optional CPU offloading to save some GPU Memory
52
+ pipe.enable_model_cpu_offload()
53
+
54
+ # Loading Trained LoRA Weights
55
+ pipe.load_lora_weights("KorAI/sdxl-base-1.0-onepiece-lora")
56
+
57
+ prompt = "Acilia Anime, anime character in a bikini with a sword and shield"
58
+
59
+ # Invoke pipeline to generate image
60
+ image = pipe(
61
+ prompt = prompt,
62
+ num_inference_steps=50,
63
+ height=1024,
64
+ width=1024,
65
+ guidance_scale=7.0,
66
+ ).images[0]
67
+
68
+ # Display image
69
+ image
70
+
71
+ # Save Image
72
+ image.save(f"sdxl_onepiece.png")
73
  ```
74
 
75
  #### Limitations and bias