Text-to-Image
Diffusers
Safetensors
English
StableDiffusionXLPipeline
stable-diffusion
stable-diffusion-xl
8-bit precision
Instructions to use msArray/animagine-xl-4.0-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use msArray/animagine-xl-4.0-8bit with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("msArray/animagine-xl-4.0-8bit", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
File size: 1,232 Bytes
a65e3b9 930ba2e a65e3b9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ---
language:
- en
tags:
- text-to-image
- stable-diffusion
- safetensors
- stable-diffusion-xl
license: openrail++
base_model:
- cagliostrolab/animagine-xl-4.0
base_model_relation: quantized
---
# Animagine XL 4.0 8bit
## Example Code
```python
import torch
from diffusers import StableDiffusionXLPipeline
import os
import secrets
pipe = StableDiffusionXLPipeline.from_pretrained(
"msArray/animagine-xl-4.0-8bit",
torch_dtype=torch.float16,
use_safetensors=True,
device_map="cuda"
)
prompt = "1girl, toki \(blue archive\), blue archive, safe, masterpiece, high score, great score, absurdres"
negative_prompt = "lowres, bad anatomy, bad hands, text, error, missing finger, extra digits, fewer digits, cropped, worst quality, low quality, low score, bad score, average score, signature, watermark, username, blurry"
image = pipe(
prompt,
negative_prompt=negative_prompt,
width=832,
height=1216,
guidance_scale=5,
num_inference_steps=28
).images[0]
if not os.path.exists("./output"):
os.makedirs("./output")
image.save(f"./output/{secrets.token_hex(10)}.png")
```

|