Upload folder using huggingface_hub
Browse files- .gitattributes +2 -0
- LICENSE.md +51 -0
- README.md +252 -0
- mmdit.png +0 -0
- sd3.5_large_demo.png +3 -0
- stable-diffusion-v3-5-large-FP16.gguf +3 -0
- stable-diffusion-v3-5-large-Q4_0.gguf +3 -0
- stable-diffusion-v3-5-large-Q8_0.gguf +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
sd3.5_large_demo.png filter=lfs diff=lfs merge=lfs -text
|
37 |
+
*.gguf filter=lfs diff=lfs merge=lfs -text
|
LICENSE.md
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
STABILITY AI COMMUNITY LICENSE AGREEMENT
|
2 |
+
Last Updated: July 5, 2024
|
3 |
+
|
4 |
+
|
5 |
+
I. INTRODUCTION
|
6 |
+
|
7 |
+
This Agreement applies to any individual person or entity ("You", "Your" or "Licensee") that uses or distributes any portion or element of the Stability AI Materials or Derivative Works thereof for any Research & Non-Commercial or Commercial purpose. Capitalized terms not otherwise defined herein are defined in Section V below.
|
8 |
+
|
9 |
+
|
10 |
+
This Agreement is intended to allow research, non-commercial, and limited commercial uses of the Models free of charge. In order to ensure that certain limited commercial uses of the Models continue to be allowed, this Agreement preserves free access to the Models for people or organizations generating annual revenue of less than US $1,000,000 (or local currency equivalent).
|
11 |
+
|
12 |
+
|
13 |
+
By clicking "I Accept" or by using or distributing or using any portion or element of the Stability Materials or Derivative Works, You agree that You have read, understood and are bound by the terms of this Agreement. If You are acting on behalf of a company, organization or other entity, then "You" includes you and that entity, and You agree that You: (i) are an authorized representative of such entity with the authority to bind such entity to this Agreement, and (ii) You agree to the terms of this Agreement on that entity's behalf.
|
14 |
+
|
15 |
+
II. RESEARCH & NON-COMMERCIAL USE LICENSE
|
16 |
+
|
17 |
+
Subject to the terms of this Agreement, Stability AI grants You a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable and royalty-free limited license under Stability AI's intellectual property or other rights owned by Stability AI embodied in the Stability AI Materials to use, reproduce, distribute, and create Derivative Works of, and make modifications to, the Stability AI Materials for any Research or Non-Commercial Purpose. "Research Purpose" means academic or scientific advancement, and in each case, is not primarily intended for commercial advantage or monetary compensation to You or others. "Non-Commercial Purpose" means any purpose other than a Research Purpose that is not primarily intended for commercial advantage or monetary compensation to You or others, such as personal use (i.e., hobbyist) or evaluation and testing.
|
18 |
+
|
19 |
+
III. COMMERCIAL USE LICENSE
|
20 |
+
|
21 |
+
Subject to the terms of this Agreement (including the remainder of this Section III), Stability AI grants You a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable and royalty-free limited license under Stability AI's intellectual property or other rights owned by Stability AI embodied in the Stability AI Materials to use, reproduce, distribute, and create Derivative Works of, and make modifications to, the Stability AI Materials for any Commercial Purpose. "Commercial Purpose" means any purpose other than a Research Purpose or Non-Commercial Purpose that is primarily intended for commercial advantage or monetary compensation to You or others, including but not limited to, (i) creating, modifying, or distributing Your product or service, including via a hosted service or application programming interface, and (ii) for Your business's or organization's internal operations.
|
22 |
+
If You are using or distributing the Stability AI Materials for a Commercial Purpose, You must register with Stability AI at (https://stability.ai/community-license). If at any time You or Your Affiliate(s), either individually or in aggregate, generate more than USD $1,000,000 in annual revenue (or the equivalent thereof in Your local currency), regardless of whether that revenue is generated directly or indirectly from the Stability AI Materials or Derivative Works, any licenses granted to You under this Agreement shall terminate as of such date. You must request a license from Stability AI at (https://stability.ai/enterprise) , which Stability AI may grant to You in its sole discretion. If you receive Stability AI Materials, or any Derivative Works thereof, from a Licensee as part of an integrated end user product, then Section III of this Agreement will not apply to you.
|
23 |
+
|
24 |
+
IV. GENERAL TERMS
|
25 |
+
|
26 |
+
Your Research, Non-Commercial, and Commercial License(s) under this Agreement are subject to the following terms.
|
27 |
+
a. Distribution & Attribution. If You distribute or make available the Stability AI Materials or a Derivative Work to a third party, or a product or service that uses any portion of them, You shall: (i) provide a copy of this Agreement to that third party, (ii) retain the following attribution notice within a "Notice" text file distributed as a part of such copies: "This Stability AI Model is licensed under the Stability AI Community License, Copyright Β© Stability AI Ltd. All Rights Reserved", and (iii) prominently display "Powered by Stability AI" on a related website, user interface, blogpost, about page, or product documentation. If You create a Derivative Work, You may add your own attribution notice(s) to the "Notice" text file included with that Derivative Work, provided that You clearly indicate which attributions apply to the Stability AI Materials and state in the "Notice" text file that You changed the Stability AI Materials and how it was modified.
|
28 |
+
b. Use Restrictions. Your use of the Stability AI Materials and Derivative Works, including any output or results of the Stability AI Materials or Derivative Works, must comply with applicable laws and regulations (including Trade Control Laws and equivalent regulations) and adhere to the Documentation and Stability AI's AUP, which is hereby incorporated by reference. Furthermore, You will not use the Stability AI Materials or Derivative Works, or any output or results of the Stability AI Materials or Derivative Works, to create or improve any foundational generative AI model (excluding the Models or Derivative Works).
|
29 |
+
c. Intellectual Property.
|
30 |
+
(i) Trademark License. No trademark licenses are granted under this Agreement, and in connection with the Stability AI Materials or Derivative Works, You may not use any name or mark owned by or associated with Stability AI or any of its Affiliates, except as required under Section IV(a) herein.
|
31 |
+
(ii) Ownership of Derivative Works. As between You and Stability AI, You are the owner of Derivative Works You create, subject to Stability AI's ownership of the Stability AI Materials and any Derivative Works made by or for Stability AI.
|
32 |
+
(iii) Ownership of Outputs. As between You and Stability AI, You own any outputs generated from the Models or Derivative Works to the extent permitted by applicable law.
|
33 |
+
(iv) Disputes. If You or Your Affiliate(s) institute litigation or other proceedings against Stability AI (including a cross-claim or counterclaim in a lawsuit) alleging that the Stability AI Materials, Derivative Works or associated outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by You, then any licenses granted to You under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Stability AI from and against any claim by any third party arising out of or related to Your use or distribution of the Stability AI Materials or Derivative Works in violation of this Agreement.
|
34 |
+
(v) Feedback. From time to time, You may provide Stability AI with verbal and/or written suggestions, comments or other feedback related to Stability AI's existing or prospective technology, products or services (collectively, "Feedback"). You are not obligated to provide Stability AI with Feedback, but to the extent that You do, You hereby grant Stability AI a perpetual, irrevocable, royalty-free, fully-paid, sub-licensable, transferable, non-exclusive, worldwide right and license to exploit the Feedback in any manner without restriction. Your Feedback is provided "AS IS" and You make no warranties whatsoever about any Feedback.
|
35 |
+
d. Disclaimer Of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE STABILITY AI MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OR LAWFULNESS OF USING OR REDISTRIBUTING THE STABILITY AI MATERIALS, DERIVATIVE WORKS OR ANY OUTPUT OR RESULTS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE STABILITY AI MATERIALS, DERIVATIVE WORKS AND ANY OUTPUT AND RESULTS.
|
36 |
+
e. Limitation Of Liability. IN NO EVENT WILL STABILITY AI OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF STABILITY AI OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
|
37 |
+
f. Term And Termination. The term of this Agreement will commence upon Your acceptance of this Agreement or access to the Stability AI Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Stability AI may terminate this Agreement if You are in breach of any term or condition of this Agreement. Upon termination of this Agreement, You shall delete and cease use of any Stability AI Materials or Derivative Works. Section IV(d), (e), and (g) shall survive the termination of this Agreement.
|
38 |
+
g. Governing Law. This Agreement will be governed by and constructed in accordance with the laws of the United States and the State of California without regard to choice of law principles, and the UN Convention on Contracts for International Sale of Goods does not apply to this Agreement.
|
39 |
+
|
40 |
+
V. DEFINITIONS
|
41 |
+
|
42 |
+
"Affiliate(s)" means any entity that directly or indirectly controls, is controlled by, or is under common control with the subject entity; for purposes of this definition, "control" means direct or indirect ownership or control of more than 50% of the voting interests of the subject entity.
|
43 |
+
"Agreement" means this Stability AI Community License Agreement.
|
44 |
+
"AUP" means the Stability AI Acceptable Use Policy available at https://stability.ai/use-policy, as may be updated from time to time.
|
45 |
+
"Derivative Work(s)" means (a) any derivative work of the Stability AI Materials as recognized by U.S. copyright laws and (b) any modifications to a Model, and any other model created which is based on or derived from the Model or the Model's output, including"fine tune" and "low-rank adaptation" models derived from a Model or a Model's output, but do not include the output of any Model.
|
46 |
+
"Documentation" means any specifications, manuals, documentation, and other written information provided by Stability AI related to the Software or Models.
|
47 |
+
"Model(s)" means, collectively, Stability AI's proprietary models and algorithms, including machine-learning models, trained model weights and other elements of the foregoing listed on Stability's Core Models Webpage available at, https://stability.ai/core-models, as may be updated from time to time.
|
48 |
+
"Stability AI" or "we" means Stability AI Ltd. and its Affiliates.
|
49 |
+
"Software" means Stability AI's proprietary software made available under this Agreement now or in the future.
|
50 |
+
"Stability AI Materials" means, collectively, Stability's proprietary Models, Software and Documentation (and any portion or combination thereof) made available under this Agreement.
|
51 |
+
"Trade Control Laws" means any applicable U.S. and non-U.S. export control and trade sanctions laws and regulations.
|
README.md
ADDED
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: stabilityai-ai-community
|
4 |
+
license_link: LICENSE.md
|
5 |
+
tags:
|
6 |
+
- text-to-image
|
7 |
+
- stable-diffusion
|
8 |
+
- diffusers
|
9 |
+
inference: true
|
10 |
+
extra_gated_prompt: >-
|
11 |
+
By clicking "Agree", you agree to the [License
|
12 |
+
Agreement](https://huggingface.co/stabilityai/stable-diffusion-3.5-large/blob/main/LICENSE.md)
|
13 |
+
and acknowledge Stability AI's [Privacy
|
14 |
+
Policy](https://stability.ai/privacy-policy).
|
15 |
+
extra_gated_fields:
|
16 |
+
Name: text
|
17 |
+
Email: text
|
18 |
+
Country: country
|
19 |
+
Organization or Affiliation: text
|
20 |
+
Receive email updates and promotions on Stability AI products, services, and research?:
|
21 |
+
type: select
|
22 |
+
options:
|
23 |
+
- 'Yes'
|
24 |
+
- 'No'
|
25 |
+
What do you intend to use the model for?:
|
26 |
+
type: select
|
27 |
+
options:
|
28 |
+
- Research
|
29 |
+
- Personal use
|
30 |
+
- Creative Professional
|
31 |
+
- Startup
|
32 |
+
- Enterprise
|
33 |
+
I agree to the License Agreement and acknowledge Stability AI's Privacy Policy: checkbox
|
34 |
+
|
35 |
+
language:
|
36 |
+
- en
|
37 |
+
pipeline_tag: text-to-image
|
38 |
+
---
|
39 |
+
|
40 |
+
# stable-diffusion-v3-5-large-GGUF
|
41 |
+
|
42 |
+
!!! Experimental supported by [gpustack/llama-box v0.0.75+](https://github.com/gpustack/llama-box) only !!!
|
43 |
+
|
44 |
+
**Model creator**: [Stability AI](https://huggingface.co/stabilityai)<br/>
|
45 |
+
**Original model**: [stable-diffusion-3.5-large](https://huggingface.co/stabilityai/stable-diffusion-3.5-large)<br/>
|
46 |
+
**GGUF quantization**: based on stable-diffusion.cpp [ac54e](https://github.com/leejet/stable-diffusion.cpp/commit/ac54e0076052a196b7df961eb1f792c9ff4d7f22) that patched by llama-box.
|
47 |
+
|
48 |
+
---
|
49 |
+
|
50 |
+
# Stable Diffusion 3.5 Large
|
51 |
+
![3.5 Large Demo Image](sd3.5_large_demo.png)
|
52 |
+
|
53 |
+
## Model
|
54 |
+
|
55 |
+
![MMDiT](mmdit.png)
|
56 |
+
|
57 |
+
|
58 |
+
[Stable Diffusion 3.5 Large](https://stability.ai/news/introducing-stable-diffusion-3-5) is a Multimodal Diffusion Transformer (MMDiT) text-to-image model that features improved performance in image quality, typography, complex prompt understanding, and resource-efficiency.
|
59 |
+
|
60 |
+
Please note: This model is released under the [Stability Community License](https://stability.ai/community-license-agreement). Visit [Stability AI](https://stability.ai/license) to learn or [contact us](https://stability.ai/enterprise) for commercial licensing details.
|
61 |
+
|
62 |
+
|
63 |
+
### Model Description
|
64 |
+
|
65 |
+
- **Developed by:** Stability AI
|
66 |
+
- **Model type:** MMDiT text-to-image generative model
|
67 |
+
- **Model Description:** This model generates images based on text prompts. It is a [Multimodal Diffusion Transformer](https://arxiv.org/abs/2403.03206) that use three fixed, pretrained text encoders, and with QK-normalization to improve training stability.
|
68 |
+
|
69 |
+
### License
|
70 |
+
|
71 |
+
- **Community License:** Free for research, non-commercial, and commercial use for organizations or individuals with less than $1M in total annual revenue. More details can be found in the [Community License Agreement](https://stability.ai/community-license-agreement). Read more at https://stability.ai/license.
|
72 |
+
- **For individuals and organizations with annual revenue above $1M**: please [contact us](https://stability.ai/enterprise) to get an Enterprise License.
|
73 |
+
|
74 |
+
### Model Sources
|
75 |
+
|
76 |
+
For local or self-hosted use, we recommend [ComfyUI](https://github.com/comfyanonymous/ComfyUI) for node-based UI inference, or [diffusers](https://github.com/huggingface/diffusers) or [GitHub](https://github.com/Stability-AI/sd3.5) for programmatic use.
|
77 |
+
|
78 |
+
- **ComfyUI:** [Github](https://github.com/comfyanonymous/ComfyUI), [Example Workflow](https://comfyanonymous.github.io/ComfyUI_examples/sd3/)
|
79 |
+
- **Huggingface Space:** [Space](https://huggingface.co/spaces/stabilityai/stable-diffusion-3.5-large)
|
80 |
+
- **Diffusers**: [See below](#using-with-diffusers).
|
81 |
+
- **GitHub**: [GitHub](https://github.com/Stability-AI/sd3.5).
|
82 |
+
|
83 |
+
- **API Endpoints:**
|
84 |
+
- [Stability AI API](https://platform.stability.ai/docs/api-reference#tag/Generate/paths/~1v2beta~1stable-image~1generate~1sd3/post)
|
85 |
+
- [Replicate](https://replicate.com/stability-ai/stable-diffusion-3.5-large)
|
86 |
+
- [Deepinfra](https://deepinfra.com/stabilityai/sd3.5)
|
87 |
+
|
88 |
+
|
89 |
+
### Implementation Details
|
90 |
+
|
91 |
+
- **QK Normalization:** Implements the QK normalization technique to improve training Stability.
|
92 |
+
|
93 |
+
- **Text EncodersοΌ**
|
94 |
+
- CLIPs: [OpenCLIP-ViT/G](https://github.com/mlfoundations/open_clip), [CLIP-ViT/L](https://github.com/openai/CLIP/tree/main), context length 77 tokens
|
95 |
+
- T5: [T5-xxl](https://huggingface.co/google/t5-v1_1-xxl), context length 77/256 tokens at different stages of training
|
96 |
+
|
97 |
+
- **Training Data and Strategy:**
|
98 |
+
|
99 |
+
This model was trained on a wide variety of data, including synthetic data and filtered publicly available data.
|
100 |
+
|
101 |
+
For more technical details of the original MMDiT architecture, please refer to the [Research paper](https://stability.ai/news/stable-diffusion-3-research-paper).
|
102 |
+
|
103 |
+
|
104 |
+
### Model Performance
|
105 |
+
|
106 |
+
See [blog](https://stability.ai/news/introducing-stable-diffusion-3-5) for our study about comparative performance in prompt adherence and aesthetic quality.
|
107 |
+
|
108 |
+
|
109 |
+
## File Structure
|
110 |
+
|
111 |
+
Click here to access the [Files and versions tab](https://huggingface.co/stabilityai/stable-diffusion-3.5-large/tree/main)
|
112 |
+
|
113 |
+
```β
|
114 |
+
βββ text_encoders/
|
115 |
+
β βββ README.md
|
116 |
+
β βββ clip_g.safetensors
|
117 |
+
β βββ clip_l.safetensors
|
118 |
+
β βββ t5xxl_fp16.safetensors
|
119 |
+
β βββ t5xxl_fp8_e4m3fn.safetensors
|
120 |
+
β
|
121 |
+
βββ README.md
|
122 |
+
βββ LICENSE
|
123 |
+
βββ sd3_large.safetensors
|
124 |
+
βββ SD3.5L_example_workflow.json
|
125 |
+
βββ sd3_large_demo.png
|
126 |
+
|
127 |
+
** File structure below is for diffusers integration**
|
128 |
+
βββ scheduler/
|
129 |
+
βββ text_encoder/
|
130 |
+
βββ text_encoder_2/
|
131 |
+
βββ text_encoder_3/
|
132 |
+
βββ tokenizer/
|
133 |
+
βββ tokenizer_2/
|
134 |
+
βββ tokenizer_3/
|
135 |
+
βββ transformer/
|
136 |
+
βββ vae/
|
137 |
+
βββ model_index.json
|
138 |
+
```
|
139 |
+
|
140 |
+
## Using with Diffusers
|
141 |
+
Upgrade to the latest version of the [𧨠diffusers library](https://github.com/huggingface/diffusers)
|
142 |
+
```
|
143 |
+
pip install -U diffusers
|
144 |
+
```
|
145 |
+
|
146 |
+
and then you can run
|
147 |
+
```py
|
148 |
+
import torch
|
149 |
+
from diffusers import StableDiffusion3Pipeline
|
150 |
+
|
151 |
+
pipe = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3.5-large", torch_dtype=torch.bfloat16)
|
152 |
+
pipe = pipe.to("cuda")
|
153 |
+
|
154 |
+
image = pipe(
|
155 |
+
"A capybara holding a sign that reads Hello World",
|
156 |
+
num_inference_steps=28,
|
157 |
+
guidance_scale=3.5,
|
158 |
+
).images[0]
|
159 |
+
image.save("capybara.png")
|
160 |
+
```
|
161 |
+
|
162 |
+
### Quantizing the model with diffusers
|
163 |
+
|
164 |
+
Reduce your VRAM usage and have the model fit on π€ VRAM GPUs
|
165 |
+
|
166 |
+
```
|
167 |
+
pip install bitsandbytes
|
168 |
+
```
|
169 |
+
|
170 |
+
```py
|
171 |
+
from diffusers import BitsAndBytesConfig, SD3Transformer2DModel
|
172 |
+
from diffusers import StableDiffusion3Pipeline
|
173 |
+
import torch
|
174 |
+
|
175 |
+
model_id = "stabilityai/stable-diffusion-3.5-large"
|
176 |
+
|
177 |
+
nf4_config = BitsAndBytesConfig(
|
178 |
+
load_in_4bit=True,
|
179 |
+
bnb_4bit_quant_type="nf4",
|
180 |
+
bnb_4bit_compute_dtype=torch.bfloat16
|
181 |
+
)
|
182 |
+
model_nf4 = SD3Transformer2DModel.from_pretrained(
|
183 |
+
model_id,
|
184 |
+
subfolder="transformer",
|
185 |
+
quantization_config=nf4_config,
|
186 |
+
torch_dtype=torch.bfloat16
|
187 |
+
)
|
188 |
+
|
189 |
+
pipeline = StableDiffusion3Pipeline.from_pretrained(
|
190 |
+
model_id,
|
191 |
+
transformer=model_nf4,
|
192 |
+
torch_dtype=torch.bfloat16
|
193 |
+
)
|
194 |
+
pipeline.enable_model_cpu_offload()
|
195 |
+
|
196 |
+
prompt = "A whimsical and creative image depicting a hybrid creature that is a mix of a waffle and a hippopotamus, basking in a river of melted butter amidst a breakfast-themed landscape. It features the distinctive, bulky body shape of a hippo. However, instead of the usual grey skin, the creature's body resembles a golden-brown, crispy waffle fresh off the griddle. The skin is textured with the familiar grid pattern of a waffle, each square filled with a glistening sheen of syrup. The environment combines the natural habitat of a hippo with elements of a breakfast table setting, a river of warm, melted butter, with oversized utensils or plates peeking out from the lush, pancake-like foliage in the background, a towering pepper mill standing in for a tree. As the sun rises in this fantastical world, it casts a warm, buttery glow over the scene. The creature, content in its butter river, lets out a yawn. Nearby, a flock of birds take flight"
|
197 |
+
|
198 |
+
image = pipeline(
|
199 |
+
prompt=prompt,
|
200 |
+
num_inference_steps=28,
|
201 |
+
guidance_scale=4.5,
|
202 |
+
max_sequence_length=512,
|
203 |
+
).images[0]
|
204 |
+
image.save("whimsical.png")
|
205 |
+
```
|
206 |
+
|
207 |
+
### Fine-tuning
|
208 |
+
|
209 |
+
Please see the fine-tuning guide [here](https://stabilityai.notion.site/Stable-Diffusion-3-5-Large-Fine-tuning-Tutorial-11a61cdcd1968027a15bdbd7c40be8c6).
|
210 |
+
|
211 |
+
|
212 |
+
## Uses
|
213 |
+
|
214 |
+
### Intended Uses
|
215 |
+
|
216 |
+
Intended uses include the following:
|
217 |
+
* Generation of artworks and use in design and other artistic processes.
|
218 |
+
* Applications in educational or creative tools.
|
219 |
+
* Research on generative models, including understanding the limitations of generative models.
|
220 |
+
|
221 |
+
All uses of the model must be in accordance with our [Acceptable Use Policy](https://stability.ai/use-policy).
|
222 |
+
|
223 |
+
### Out-of-Scope Uses
|
224 |
+
|
225 |
+
The model was not trained to be factual or true representations of people or events. As such, using the model to generate such content is out-of-scope of the abilities of this model.
|
226 |
+
|
227 |
+
## Safety
|
228 |
+
|
229 |
+
As part of our safety-by-design and responsible AI deployment approach, we take deliberate measures to ensure Integrity starts at the early stages of development. We implement safety measures throughout the development of our models. We have implemented safety mitigations that are intended to reduce the risk of certain harms, however we recommend that developers conduct their own testing and apply additional mitigations based on their specific use cases.
|
230 |
+
For more about our approach to Safety, please visit our [Safety page](https://stability.ai/safety).
|
231 |
+
|
232 |
+
### Integrity Evaluation
|
233 |
+
|
234 |
+
Our integrity evaluation methods include structured evaluations and red-teaming testing for certain harms. Testing was conducted primarily in English and may not cover all possible harms.
|
235 |
+
|
236 |
+
### Risks identified and mitigations:
|
237 |
+
|
238 |
+
* Harmful content: We have used filtered data sets when training our models and implemented safeguards that attempt to strike the right balance between usefulness and preventing harm. However, this does not guarantee that all possible harmful content has been removed. TAll developers and deployers should exercise caution and implement content safety guardrails based on their specific product policies and application use cases.
|
239 |
+
* Misuse: Technical limitations and developer and end-user education can help mitigate against malicious applications of models. All users are required to adhere to our [Acceptable Use Policy](https://stability.ai/use-policy), including when applying fine-tuning and prompt engineering mechanisms. Please reference the Stability AI Acceptable Use Policy for information on violative uses of our products.
|
240 |
+
* Privacy violations: Developers and deployers are encouraged to adhere to privacy regulations with techniques that respect data privacy.
|
241 |
+
|
242 |
+
### Contact
|
243 |
+
|
244 |
+
Please report any issues with the model or contact us:
|
245 |
+
|
246 |
+
* Safety issues: [email protected]
|
247 |
+
* Security issues: [email protected]
|
248 |
+
* Privacy issues: [email protected]
|
249 |
+
* License and general: https://stability.ai/license
|
250 |
+
* Enterprise license: https://stability.ai/enterprise
|
251 |
+
|
252 |
+
|
mmdit.png
ADDED
sd3.5_large_demo.png
ADDED
Git LFS Details
|
stable-diffusion-v3-5-large-FP16.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:20ff07d2d66777569cceb2b06699fcb06923177449db39a2c316e50082f3ce3e
|
3 |
+
size 15183719104
|
stable-diffusion-v3-5-large-Q4_0.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7445014d7c5dffbbb70ba6f1210407ea37afba52dd22af92c0fd6901b1d66570
|
3 |
+
size 8321019840
|
stable-diffusion-v3-5-large-Q8_0.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:20ff07d2d66777569cceb2b06699fcb06923177449db39a2c316e50082f3ce3e
|
3 |
+
size 15183719104
|