Warlord-K commited on
Commit
ab90d7b
·
verified ·
1 Parent(s): c6d7955

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +125 -0
README.md ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - text-to-image
5
+ - ultra-realistic
6
+ - text-to-image
7
+ - stable-diffusion
8
+ - mixture-of-experts
9
+ - segmoe
10
+ pinned: true
11
+ library_name: diffusers
12
+ ---
13
+
14
+ # SegMoE-2x1-v0: Segmind Mixture of Diffusion Experts
15
+
16
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/62f8ca074588fe31f4361dae/TJTQyN9tav94fVcvpZGq8.png)
17
+
18
+ SegMoE-2x1-v0 is an untrained Segmind Mixture of Diffusion Experts Model generated using [segmoe](https://github.com/segmind/segmoe) from 2 Expert SDXL models. SegMoE is a powerful framework for dynamically combining Stable Diffusion Models into a Mixture of Experts within minutes without training. The framework allows for creation of larger models on the fly which offer larger knowledge, better adherence and better image quality.
19
+
20
+ ## Usage
21
+
22
+ This model can be used via the [segmoe](https://github.com/segmind/segmoe) library.
23
+
24
+ Make sure to install segmoe by running
25
+
26
+ ```bash
27
+ pip install segmoe
28
+ ```
29
+
30
+ ```python
31
+ from segmoe import SegMoEPipeline
32
+
33
+ pipeline = SegMoEPipeline("segmind/SegMoE-2x1-v0", device = "cuda")
34
+
35
+ prompt = "cosmic canvas, orange city background, painting of a chubby cat"
36
+ negative_prompt = "nsfw, bad quality, worse quality"
37
+ img = pipeline(
38
+ prompt=prompt,
39
+ negative_prompt=negative_prompt,
40
+ height=1024,
41
+ width=1024,
42
+ num_inference_steps=25,
43
+ guidance_scale=7.5,
44
+ ).images[0]
45
+ img.save("image.png")
46
+ ```
47
+
48
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/62f8ca074588fe31f4361dae/ofIz_6VehCHRlpsfrxwFm.png)
49
+
50
+ ### Config
51
+ Config Used to create this Model is:
52
+
53
+ ```yaml
54
+ base_model: SG161222/RealVisXL_V3.0
55
+ num_experts: 2
56
+ moe_layers: all
57
+ num_experts_per_tok: 1
58
+ experts:
59
+ - source_model: frankjoshua/juggernautXL_v8Rundiffusion
60
+ positive_prompt: "aesthetic, cinematic, hands, portrait, photo, illustration, 8K, hyperdetailed, origami, man, woman, supercar"
61
+ negative_prompt: "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)"
62
+ - source_model: SG161222/RealVisXL_V3.0
63
+ positive_prompt: "cinematic, portrait, photograph, instagram, fashion, movie, macro shot, 8K, RAW, hyperrealistic, ultra realistic,"
64
+ negative_prompt: "(octane render, render, drawing, anime, bad photo, bad photography:1.3), (worst quality, low quality, blurry:1.2), (bad teeth, deformed teeth, deformed lips), (bad anatomy, bad proportions:1.1), (deformed iris, deformed pupils), (deformed eyes, bad eyes), (deformed face, ugly face, bad face), (deformed hands, bad hands, fused fingers), morbid, mutilated, mutation, disfigured"
65
+ ```
66
+
67
+ ### Other Variants
68
+
69
+ We release 3 merges on Hugging Face,
70
+
71
+ - [SegMoE 4x2](https://huggingface.co/segmind/SegMoE-2x1-v0) has four expert models.
72
+ - [SegMoE SD 4x2](https://huggingface.co/segmind/SegMoE-sd-4x2-v0) has four Stable Diffusion 1.5 expert models.
73
+
74
+ ## Comparison
75
+
76
+ The Prompt Understanding seems to improve as shown in the images below. From Left to Right SegMoE-2x1-v0, SegMoE-4x2-v0, Base Model ([RealVisXL_V3.0](https://huggingface.co/SG161222/RealVisXL_V3.0))
77
+
78
+ ![image](https://github.com/segmind/segmoe/assets/95569637/bcdc1b11-bbf5-4947-b6bb-9f745ff0c040)
79
+
80
+ <div align="center">three green glass bottles</div>
81
+ <br>
82
+
83
+ ![image](https://github.com/segmind/segmoe/assets/95569637/d50e2af0-66d2-4112-aa88-bd4df88cbd5e)
84
+
85
+ <div align="center">panda bear with aviator glasses on its head</div>
86
+ <br>
87
+
88
+ ![image](https://github.com/segmind/segmoe/assets/95569637/aba2954a-80c2-428a-bf76-0a70a5e03e9b)
89
+
90
+ <div align="center">the statue of Liberty next to the Washington Monument</div>
91
+
92
+ ### Model Description
93
+
94
+ - **Developed by:** [Segmind](https://www.segmind.com/)
95
+ - **Developers:** [Yatharth Gupta](https://huggingface.co/Warlord-K) and [Vishnu Jaddipal](https://huggingface.co/Icar).
96
+ - **Model type:** Diffusion-based text-to-image generative mixture of experts model
97
+ - **License:** Apache 2.0
98
+
99
+ ### Out-of-Scope Use
100
+
101
+ The SegMoE-2x1-v0 Model is not suitable for creating factual or accurate representations of people, events, or real-world information. It is not intended for tasks requiring high precision and accuracy.
102
+
103
+ ## Advantages
104
+ + Benefits from The Knowledge of Several Finetuned Experts
105
+ + Training Free
106
+ + Better Adaptability to Data
107
+ + Model Can be upgraded by using a better finetuned model as one of the experts.
108
+
109
+ ## Limitations
110
+ + Though the Model improves upon the fidelity of images as well as adherence, it does not be drastically better than any one expert without training and relies on the knowledge of the experts.
111
+ + This is not yet optimized for speed.
112
+ + The framework is not yet optimized for memory usage.
113
+
114
+ ## Citation
115
+
116
+ ```bibtex
117
+ @misc{segmoe,
118
+ author = {Yatharth Gupta, Vishnu V Jaddipal, Harish Prabhala},
119
+ title = {SegMoE},
120
+ year = {2024},
121
+ publisher = {HuggingFace},
122
+ journal = {HuggingFace Models},
123
+ howpublished = {\url{https://huggingface.co/segmind/SegMoE-2x1-v0}}
124
+ }
125
+ ```