File size: 1,349 Bytes
c6ef664
 
829f49a
 
c6ef664
829f49a
 
 
 
 
 
1fc910e
829f49a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1fc910e
829f49a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
---
license: cc0-1.0
language:
- en
---
# Generalis V1.1

<hr>

### Second attempt at merging several models v1.5 into one general purpose model.

Focus has been put into simple prompts, good one-off generation, slightly muted colours, low memory usage, small model size.

It is intended as easy model for use in larger projects where image generation is needed.

Published under CC0

<hr>

Use example:

```python
import torch    # Tested with 2.0.1+cu118
from diffusers import StableDiffusionPipeline    # <3


# Model location in HF 
model = "https://huggingface.co/vluz/Generalis_V1.1/blob/main/Generalis_v1-1.safetensors"

# Create pipe
pipe = StableDiffusionPipeline.from_ckpt(model, 
    torch_dtype=torch.float16, 
    safety_checker=None,
    feature_extractor=None,
    requires_safety_checker=False,)

# Cleanup
del pipe.vae.encoder
torch.cuda.empty_cache()

# Send to GPU
pipe = pipe.to("cuda")

# Optimize for low vram use and clear cache again
pipe.enable_vae_tiling()
pipe.enable_attention_slicing("max")
pipe.enable_xformers_memory_efficient_attention(attention_op=None)
pipe.unet.to(memory_format=torch.channels_last)
pipe.enable_sequential_cpu_offload()
torch.cuda.empty_cache()

# Set a prompt
prompt = "a cat"

# Generate image based on prompt
image = pipe(prompt).images[0]

# Save result image to disk
image.save("cat.png")
```