Andyrasika commited on
Commit
7d15c50
·
1 Parent(s): 92d9f28

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -1
README.md CHANGED
@@ -5,4 +5,32 @@ language:
5
  library_name: transformers
6
  tags:
7
  - diffusion
8
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  library_name: transformers
6
  tags:
7
  - diffusion
8
+ ---
9
+ ```
10
+ import torch
11
+ from diffusers import StableDiffusionXLPipeline
12
+ import gc,cv2,os
13
+ from PIL import Image
14
+ import requests
15
+ from io import BytesIO
16
+ from IPython.display import display
17
+ import matplotlib.pyplot as plt
18
+
19
+ vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
20
+
21
+ pipe = StableDiffusionXLPipeline.from_pretrained(
22
+ "/content/output_folder", torch_dtype=torch.float16, variant="fp16",vae=vae, use_safetensors=True
23
+ )
24
+ pipe.enable_xformers_memory_efficient_attention()
25
+ pipe.to("cuda")
26
+ prompt = '8k intricate, highly detailed, digital photography, best quality, masterpiece, a (full body "shot) photo of A warrior man that lived with dragons his whole life is now leading them to battle. torn clothes exposing parts of her body, scratch marks, epic, hyperrealistic, hyperrealism, 8k, cinematic lighting, greg rutkowski, wlop'
27
+ negative_prompt='(deformed iris, deformed pupils), text, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, (extra fingers), (mutated hands), poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, (fused fingers), (too many fingers), long neck, camera'
28
+
29
+ image = pipe(prompt=prompt,
30
+ negative_prompt=negative_prompt,
31
+ guidance_scale=9.0,
32
+ num_inference_steps=50).images[0]
33
+
34
+ gc.collect()
35
+ torch.cuda.empty_cache()
36
+ ```