Andyrasika's picture
Update README.md
7d15c50
|
raw
history blame
No virus
1.62 kB
---
license: creativeml-openrail-m
language:
- en
library_name: transformers
tags:
- diffusion
---
```
import torch
from diffusers import StableDiffusionXLPipeline
import gc,cv2,os
from PIL import Image
import requests
from io import BytesIO
from IPython.display import display
import matplotlib.pyplot as plt
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
pipe = StableDiffusionXLPipeline.from_pretrained(
"/content/output_folder", torch_dtype=torch.float16, variant="fp16",vae=vae, use_safetensors=True
)
pipe.enable_xformers_memory_efficient_attention()
pipe.to("cuda")
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'
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'
image = pipe(prompt=prompt,
negative_prompt=negative_prompt,
guidance_scale=9.0,
num_inference_steps=50).images[0]
gc.collect()
torch.cuda.empty_cache()
```