shimmyshimmer commited on
Commit
1f2165e
·
verified ·
1 Parent(s): da82984

Upload GGUF quantizations of FLUX.2-dev

Browse files
.gitattributes CHANGED
@@ -33,3 +33,21 @@ 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
+ flux2-dev-BF16.gguf filter=lfs diff=lfs merge=lfs -text
37
+ flux2-dev-F16.gguf filter=lfs diff=lfs merge=lfs -text
38
+ flux2-dev-Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
39
+ flux2-dev-Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
40
+ flux2-dev-Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
41
+ flux2-dev-Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
42
+ flux2-dev-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
43
+ flux2-dev-Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
44
+ flux2-dev-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
45
+ flux2-dev-Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text
46
+ flux2-dev-Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
47
+ flux2-dev-Q5_1.gguf filter=lfs diff=lfs merge=lfs -text
48
+ flux2-dev-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
49
+ flux2-dev-Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
50
+ flux2-dev-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
51
+ flux2-dev-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
52
+ teaser_editing.png filter=lfs diff=lfs merge=lfs -text
53
+ teaser_generation.png filter=lfs diff=lfs merge=lfs -text
LICENSE.txt ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FLUX [dev] Non-Commercial License v2.0
2
+
3
+ Black Forest Labs Inc. (“we” or “our” or “Company”) is pleased to make the weights, parameters, and inference code for the FLUX [dev] Models (as defined below) freely available for your non-commercial and non-production use as set forth in this FLUX [dev] Non-Commercial License (“License”). “Models” includes the models denoted as FLUX.x [dev], where “.x” denotes the FLUX model version number, including but not limited to FLUX.1 [dev], FLUX.1 Fill [dev], FLUX.1 Depth [dev], FLUX.1 Canny [dev], FLUX.1 Redux [dev], FLUX.1 Canny [dev] LoRA, FLUX.1 Depth [dev] LoRA, FLUX.1 Kontext [dev], FLUX.1 Krea [dev], and FLUX.2 [dev], and their elements which includes algorithms, software, checkpoints, parameters, source code (inference code, evaluation code, and if applicable, fine-tuning code) and any other materials associated with the FLUX [dev] AI models made available by Company under this License, including if any, the technical documentation, manuals, and instructions for the use and operation thereof (individually and collectively, the “FLUX [dev] Models”). Note that we may also make available certain elements of what is included in the definition of “FLUX [dev] Model” under a separate license, such as the inference code, and nothing in this License will be deemed to restrict or limit any other licenses granted by us in such elements.
4
+
5
+ By downloading, accessing, using, Distributing (as defined below), or creating a Derivative (as defined below) of the FLUX [dev] Model, you agree to the terms of this License. If you do not agree to this License, then you do not have any rights to access, use, Distribute or create a Derivative of the FLUX [dev] Model and you must immediately cease using the FLUX [dev] Model. If you are agreeing to be bound by the terms of this License on behalf of your employer or other entity, you represent and warrant to us that you have full legal authority to bind your employer or such entity to this License. If you do not have the requisite authority, you may not accept the License or access the FLUX [dev] Model on behalf of your employer or other entity.
6
+
7
+ 1. Definitions.
8
+ a. “Derivative” means any (i) modified version of the FLUX [dev] Model (including but not limited to any customized or fine-tuned version thereof), (ii) work based on the FLUX [dev] Model, or (iii) any other derivative work thereof. For the avoidance of doubt, Outputs are not considered Derivatives under this License.
9
+ b. “Distribution” or “Distribute” or “Distributing” means providing or making available, by any means, a copy of the FLUX [dev] Models and/or the Derivatives as the case may be.
10
+ c. “Non-Commercial Purpose” means any of the following uses, but only so far as you do not receive any direct or indirect payment arising from the use of the FLUX [dev] Model, Derivatives, or Content Filters (as defined below): (i) personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, or otherwise not directly or indirectly connected to any commercial activities, business operations, or employment responsibilities; (ii) use by commercial or for-profit entities for testing, evaluation, or non-commercial research and development in a non-production environment; and (iii) use by any charitable organization for charitable purposes, or for testing or evaluation. For clarity, use (a) for revenue-generating activity, (b) in direct interactions with or that has impact on end users, or (c) to train, fine tune, or distill other models for commercial use, in each case, is not a Non-Commercial Purpose.
11
+ d. “Outputs” means any content generated by the operation of the FLUX [dev] Models or Derivatives from an input (such as an image input) or prompt (i.e., text instructions) provided by users. For the avoidance of doubt, Outputs do not include any components of the FLUX [dev] Models, such as any fine-tuned versions of the FLUX [dev] Models, the weights, or parameters.
12
+ e. “you” or “your” means the individual or entity entering into this License with Company.
13
+
14
+ 2. License Grant.
15
+ a. License. Subject to your compliance with this License, Company grants you a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable, royalty free, and limited license to access, use, create Derivatives of, and Distribute the FLUX [dev] Models and Derivatives solely for your Non-Commercial Purposes. The foregoing license is personal to you, and you may not assign or sublicense this License or any other rights or obligations under this License without Company’s prior written consent; any such assignment or sublicense will be void and will automatically and immediately terminate this License. Any restrictions set forth herein regarding the FLUX [dev] Model also apply to any Derivative you create or that are created on your behalf.
16
+ b. Non-Commercial Use Only. You may only access, use, Distribute, or create Derivatives of the FLUX [dev] Model or Derivatives for Non-Commercial Purposes. If you want to use a FLUX [dev] Model or a Derivative for any purpose that is not expressly authorized under this License, such as for a commercial activity, you must request a license from Company, which Company may grant to you in Company’s sole discretion and which additional use may be subject to a fee, royalty or other revenue share. Please see www.bfl.ai if you would like a commercial license.
17
+ c. Reserved Rights. The grant of rights expressly set forth in this License are the complete grant of rights to you in the FLUX [dev] Model, and no other licenses are granted, whether by waiver, estoppel, implication, equity, or otherwise. Company and its licensors reserve all rights not expressly granted by this License.
18
+ d. Outputs. We claim no ownership rights in and to the Outputs. You are solely responsible for the Outputs you generate and their subsequent uses in accordance with this License. You may use Output for any purpose (including for commercial purposes), except as expressly prohibited herein. You may not use the Output to train, fine-tune, or distill a model that is competitive with a FLUX [dev] Model.
19
+ e. You may access, use, Distribute, or create Output of the FLUX [dev] Model or Derivatives if you: (i) (A) implement and maintain content filtering measures (“Content Filters”) for your use of the FLUX [dev] Model or Derivatives to prevent the creation, display, transmission, generation, or dissemination of unlawful or infringing content, which may include Content Filters that we may make available for use with the FLUX [dev] Model (“Provided Content Filters”), or (B) ensure Output undergoes review for unlawful or infringing content before public or non-public distribution, display, transmission or dissemination; and (ii) ensure Output includes disclosure (or other indication) that the Output was generated or modified using artificial intelligence technologies to the extent required under applicable law.
20
+
21
+ 3. Distribution. Subject to this License, you may Distribute copies of the FLUX [dev] Model and/or Derivatives made by you, under the following conditions:
22
+ a. you must make available a copy of this License to third-party recipients of the FLUX [dev] Models and/or Derivatives you Distribute, and specify that any rights to use the FLUX [dev] Models and/or Derivatives shall be directly granted by Company to said third-party recipients pursuant to this License;
23
+ b. you must prominently display the following notice alongside the Distribution of the FLUX [dev] Model or Derivative (such as via a “Notice” text file distributed as part of such FLUX [dev] Model or Derivative) (the “Attribution Notice”):
24
+
25
+
26
+ “The FLUX [dev] Model is licensed by Black Forest Labs Inc. under the FLUX [dev] Non-Commercial License. Copyright Black Forest Labs Inc.
27
+ IN NO EVENT SHALL BLACK FOREST LABS INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH USE OF THIS MODEL.”
28
+
29
+
30
+ c. in the case of Distribution of Derivatives made by you: (i) you must also include in the Attribution Notice a statement that you have modified the applicable FLUX [dev] Model; (ii) any terms and conditions you impose on any third-party recipients relating to Derivatives made by or for you shall neither limit such third-party recipients’ use of the FLUX [dev] Model or any Derivatives made by or for Company in accordance with this License nor conflict with any of its terms and conditions and must include disclaimer of warranties and limitation of liability provisions that are at least as protective of Company as those set forth herein; and (iii) you must not misrepresent or imply, through any means, that the Derivatives made by or for you and/or any modified version of the FLUX [dev] Model you Distribute under your name and responsibility is an official product of the Company or has been endorsed, approved or validated by the Company, unless you are authorized by Company to do so in writing.
31
+
32
+ 4. Restrictions. You will not, and will not permit, assist or cause any third party to
33
+ a. use, modify, copy, reproduce, create Derivatives of, or Distribute the FLUX [dev] Model (or any Derivative thereof, or any data produced by the FLUX [dev] Model), in whole or in part, (i) for any commercial or production purposes, (ii) military purposes, (iii) purposes of surveillance, including any research or development relating to surveillance, (iv) biometric processing, (v) in any manner that infringes, misappropriates, or otherwise violates (or is likely to infringe, misappropriate, or otherwise violate) any third party’s legal rights, including rights of publicity or “digital replica” rights, (vi) in any unlawful, fraudulent, defamatory, or abusive activity, (vii) to generate unlawful content, including child sexual abuse material, or non-consensual intimate images; or (viii) in any manner that violates any applicable law and any privacy or security laws, rules, regulations, directives, or governmental requirements (including the General Data Privacy Regulation (Regulation (EU) 2016/679), the California Consumer Privacy Act, any and all laws governing the processing of biometric information, and the EU Artificial Intelligence Act (Regulation (EU) 2024/1689), as well as all amendments and successor laws to any of the foregoing);
34
+ b. alter or remove copyright and other proprietary notices which appear on or in any portion of the FLUX [dev] Model;
35
+ c. utilize any equipment, device, software, or other means to circumvent or remove any security or protection used by Company in connection with the FLUX [dev] Model, or to circumvent or remove any usage restrictions, or to enable functionality disabled by FLUX [dev] Model;
36
+ d. offer or impose any terms on the FLUX [dev] Model that alter, restrict, or are inconsistent with the terms of this License;
37
+ e. violate any applicable U.S. and non-U.S. export control and trade sanctions laws (“Export Laws”) in connection with your use or Distribution of any FLUX [dev] Model;
38
+ f. directly or indirectly Distribute, export, or otherwise transfer FLUX [dev] Model (i) to any individual, entity, or country prohibited by Export Laws; (ii) to anyone on U.S. or non-U.S. government restricted parties lists; (iii) for any purpose prohibited by Export Laws, including nuclear, chemical or biological weapons, or missile technology applications; (iv) use or download FLUX [dev] Model if you or they are (a) located in a comprehensively sanctioned jurisdiction, (b) currently listed on any U.S. or non-U.S. restricted parties list, or (c) for any purpose prohibited by Export Laws; and (v) will not disguise your location through IP proxying or other methods.
39
+
40
+ 5. DISCLAIMERS. THE FLUX [DEV] MODEL AND PROVIDED CONTENT FILTERS ARE PROVIDED “AS IS” AND “WITH ALL FAULTS” WITH NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. COMPANY EXPRESSLY DISCLAIMS ALL REPRESENTATIONS AND WARRANTIES, EXPRESS OR IMPLIED, WHETHER BY STATUTE, CUSTOM, USAGE OR OTHERWISE AS TO ANY MATTERS RELATED TO THE FLUX [DEV] MODEL AND PROVIDED CONTENT FILTERS, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, SATISFACTORY QUALITY, OR NON-INFRINGEMENT. COMPANY MAKES NO WARRANTIES OR REPRESENTATIONS THAT THE FLUX [DEV] MODEL AND PROVIDED CONTENT FILTERS WILL BE ERROR FREE OR FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS, OR PRODUCE ANY PARTICULAR RESULTS.
41
+
42
+ 6. LIMITATION OF LIABILITY. TO THE FULLEST EXTENT PERMITTED BY LAW, IN NO EVENT WILL COMPANY BE LIABLE TO YOU OR YOUR EMPLOYEES, AFFILIATES, USERS, OFFICERS OR DIRECTORS (A) UNDER ANY THEORY OF LIABILITY, WHETHER BASED IN CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY, WARRANTY, OR OTHERWISE UNDER THIS LICENSE, OR (B) FOR ANY INDIRECT, CONSEQUENTIAL, EXEMPLARY, INCIDENTAL, PUNITIVE OR SPECIAL DAMAGES OR LOST PROFITS, EVEN IF COMPANY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THE FLUX [DEV] MODEL, ITS CONSTITUENT COMPONENTS, PROVIDED CONTENT FILTERS, AND ANY OUTPUT (COLLECTIVELY, “MODEL MATERIALS”) ARE NOT DESIGNED OR INTENDED FOR USE IN ANY APPLICATION OR SITUATION WHERE FAILURE OR FAULT OF THE MODEL MATERIALS COULD REASONABLY BE ANTICIPATED TO LEAD TO SERIOUS INJURY OF ANY PERSON, INCLUDING POTENTIAL DISCRIMINATION OR VIOLATION OF AN INDIVIDUAL’S PRIVACY RIGHTS, OR TO SEVERE PHYSICAL, PROPERTY, OR ENVIRONMENTAL DAMAGE (EACH, A “HIGH-RISK USE”). IF YOU ELECT TO USE ANY OF THE MODEL MATERIALS FOR A HIGH-RISK USE, YOU DO SO AT YOUR OWN RISK. YOU AGREE TO DESIGN AND IMPLEMENT APPROPRIATE DECISION-MAKING AND RISK-MITIGATION PROCEDURES AND POLICIES IN CONNECTION WITH A HIGH-RISK USE SUCH THAT EVEN IF THERE IS A FAILURE OR FAULT IN ANY OF THE MODEL MATERIALS, THE SAFETY OF PERSONS OR PROPERTY AFFECTED BY THE ACTIVITY STAYS AT A LEVEL THAT IS REASONABLE, APPROPRIATE, AND LAWFUL FOR THE FIELD OF THE HIGH-RISK USE.
43
+
44
+ 7. INDEMNIFICATION. You will indemnify, defend and hold harmless Company and our subsidiaries and affiliates, and each of our respective shareholders, directors, officers, employees, agents, successors, and assigns (collectively, the “Company Parties”) from and against any losses, liabilities, damages, fines, penalties, and expenses (including reasonable attorneys’ fees) incurred by any Company Party in connection with any claim, demand, allegation, lawsuit, proceeding, or investigation (collectively, “Claims”) arising out of or related to (a) your access to or use of the FLUX [dev] Model (including in connection with any Output, results or data generated from such access or use, or from your access or use of any Content Filters), including any High-Risk Use; (b) your Content Filters, including your failure to implement any Content Filters where required by this License such as in Section 2(e); (c) your violation of this License; or (d) your violation, misappropriation or infringement of any rights of another (including intellectual property or other proprietary rights and privacy rights). You will promptly notify the Company Parties of any such Claims, and cooperate with Company Parties in defending such Claims. You will also grant the Company Parties sole control of the defense or settlement, at Company’s sole option, of any Claims. This indemnity is in addition to, and not in lieu of, any other indemnities or remedies set forth in a written agreement between you and Company or the other Company Parties.
45
+
46
+ 8. Termination; Survival.
47
+ a. This License will automatically terminate upon any breach by you of the terms of this License.
48
+ b. We may terminate this License, in whole or in part, at any time upon notice (including electronic) to you.
49
+ c. If you initiate any legal action or proceedings against Company or any other entity (including a cross-claim or counterclaim in a lawsuit), alleging that the FLUX [dev] Model, any Derivative, or Provided Content Filters, or any part thereof, infringe upon intellectual property or other rights owned or licensable by you, then any licenses granted to you under this License will immediately terminate as of the date such legal action or claim is filed or initiated.
50
+ d. Upon termination of this License, you must cease all use, access or Distribution of the FLUX [dev] Model, any Derivatives, and any Provided Content Filters. The following sections survive termination of this License: 2(c), 2(d), 4-11.
51
+
52
+ 9. Third Party Materials. The FLUX [dev] Model and Provided Content Filters may contain third-party software or other components (including free and open source software) (all of the foregoing, “Third Party Materials”), which are subject to the license terms of the respective third-party licensors. Your dealings or correspondence with third parties and your use of or interaction with any Third Party Materials are solely between you and the third party. Company does not control or endorse, and makes no representations or warranties regarding, any Third Party Materials, and your access to and use of such Third Party Materials are at your own risk.
53
+
54
+ 10. Trademarks. You have not been granted any trademark license as part of this License and may not use any name, logo or trademark associated with Company without the prior written permission of Company, except to the extent necessary to make the reference required in the Attribution Notice as specified above or as is reasonably necessary in describing the FLUX [dev] Model and its creators.
55
+
56
+ 11. General. This License will be governed and construed under the laws of the State of Delaware without regard to conflicts of law provisions. If any provision or part of a provision of this License is unlawful, void or unenforceable, that provision or part of the provision is deemed severed from this License, and will not affect the validity and enforceability of any remaining provisions. The failure of Company to exercise or enforce any right or provision of this License will not operate as a waiver of such right or provision. This License does not confer any third-party beneficiary rights upon any other person or entity. This License, together with the documentation, contains the entire understanding between you and Company regarding the subject matter of this License, and supersedes all other written or oral agreements and understandings between you and Company regarding such subject matter.
README.md ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: black-forest-labs/FLUX.2-dev
3
+ language:
4
+ - en
5
+ license: other
6
+ license_name: flux-dev-non-commercial-license
7
+ license_link: https://huggingface.co/black-forest-labs/FLUX.2-dev/blob/main/LICENSE.txt
8
+ extra_gated_prompt: >-
9
+ By clicking "Agree", you agree to the [FLUX [dev] Non-Commercial License
10
+ Agreement](https://huggingface.co/black-forest-labs/FLUX.2-dev/blob/main/LICENSE.txt)
11
+ and acknowledge the [Acceptable Use
12
+ Policy](https://bfl.ai/legal/usage-policy).
13
+ tags:
14
+ - image-generation- gguf
15
+
16
+ - image-editing
17
+ - flux
18
+ - diffusion-single-file
19
+ pipeline_tag: image-to-image
20
+ library_name: ggml
21
+ ---
22
+
23
+ > [!NOTE]
24
+ > This is a GGUF quantized version of [FLUX.2-dev](https://huggingface.co/black-forest-labs/FLUX.2-dev).
25
+ > See below for available quantizations and usage instructions.
26
+
27
+
28
+ <div>
29
+ <div style="display: flex; gap: 5px; align-items: center; ">
30
+ <a href="https://github.com/unslothai/unsloth/">
31
+ <img src="https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png" width="133">
32
+ </a>
33
+ <a href="https://discord.gg/unsloth">
34
+ <img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
35
+ </a>
36
+ <a href="https://docs.unsloth.ai/new/ministral-3">
37
+ <img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
38
+ </a>
39
+ </div>
40
+ </div>
41
+
42
+ ---
43
+ ![Teaser](./teaser_generation.png)
44
+ ![Teaser](./teaser_editing.png)
45
+
46
+ `FLUX.2 [dev]` is a 32 billion parameter rectified flow transformer capable of generating, editing and combining images based on text instructions.
47
+ For more information, please read our [blog post](https://bfl.ai/blog/flux-2).
48
+
49
+ # Key Features
50
+ 1. State of the art in open text-to-image generation, single-reference editing and multi-reference editing.
51
+ 2. No need for finetuning: character, object and style reference without additional training in one model.
52
+ 4. Trained using guidance distillation, making `FLUX.2 [dev]` more efficient.
53
+ 5. Open weights to drive new scientific research, and empower artists to develop innovative workflows.
54
+ 6. Generated outputs can be used for personal, scientific, and commercial purposes, as described in the [FLUX \[dev\] Non-Commercial License](https://github.com/black-forest-labs/flux/blob/main/model_licenses/LICENSE-FLUX1-dev).
55
+
56
+ # Usage
57
+ We provide a reference implementation of `FLUX.2 [dev]`, as well as sampling code, in a dedicated [github repository](https://github.com/black-forest-labs/flux2).
58
+ Developers and creatives looking to build on top of `FLUX.2 [dev]` are encouraged to use this as a starting point.
59
+
60
+ `FLUX.2 [dev]` is also available in both [ComfyUI](https://github.com/comfyanonymous/ComfyUI) and [Diffusers](https://github.com/huggingface/diffusers).
61
+
62
+ ### Using with diffusers 🧨
63
+
64
+ For local deployment on a consumer type graphics card, like an RTX 4090 or an RTX 5090, please see the [diffusers docs](https://github.com/black-forest-labs/flux2/blob/main/docs/flux2_dev_hf.md) on our GitHub page.
65
+
66
+ As an example, here's a way to load a 4-bit quantized model with a remote text-encoder on an RTX 4090:
67
+
68
+ ```python
69
+ import torch
70
+ from diffusers import Flux2Pipeline
71
+ from diffusers.utils import load_image
72
+ from huggingface_hub import get_token
73
+ import requests
74
+ import io
75
+
76
+ repo_id = "diffusers/FLUX.2-dev-bnb-4bit" #quantized text-encoder and DiT. VAE still in bf16
77
+ device = "cuda:0"
78
+ torch_dtype = torch.bfloat16
79
+
80
+ def remote_text_encoder(prompts):
81
+ response = requests.post(
82
+ "https://remote-text-encoder-flux-2.huggingface.co/predict",
83
+ json={"prompt": prompts},
84
+ headers={
85
+ "Authorization": f"Bearer {get_token()}",
86
+ "Content-Type": "application/json"
87
+ }
88
+ )
89
+ prompt_embeds = torch.load(io.BytesIO(response.content))
90
+
91
+ return prompt_embeds.to(device)
92
+
93
+ pipe = Flux2Pipeline.from_pretrained(
94
+ repo_id, text_encoder=None, torch_dtype=torch_dtype
95
+ ).to(device)
96
+
97
+ prompt = "Realistic macro photograph of a hermit crab using a soda can as its shell, partially emerging from the can, captured with sharp detail and natural colors, on a sunlit beach with soft shadows and a shallow depth of field, with blurred ocean waves in the background. The can has the text `BFL Diffusers` on it and it has a color gradient that start with #FF5733 at the top and transitions to #33FF57 at the bottom."
98
+
99
+ #cat_image = load_image("https://huggingface.co/spaces/zerogpu-aoti/FLUX.1-Kontext-Dev-fp8-dynamic/resolve/main/cat.png")
100
+ image = pipe(
101
+ prompt_embeds=remote_text_encoder(prompt),
102
+ #image=[cat_image] #optional multi-image input
103
+ generator=torch.Generator(device=device).manual_seed(42),
104
+ num_inference_steps=50, #28 steps can be a good trade-off
105
+ guidance_scale=4,
106
+ ).images[0]
107
+
108
+ image.save("flux2_output.png")
109
+ ```
110
+
111
+
112
+ ---
113
+
114
+ # Risks
115
+
116
+ Black Forest Labs is committed to the responsible development and deployment of our models. Prior to releasing the FLUX.2 family of models, we evaluated and mitigated a number of risks in our model checkpoints and hosted services, including the generation of unlawful content such as child sexual abuse material (CSAM) and nonconsensual intimate imagery (NCII). We implemented a series of pre-release mitigations to help prevent misuse by third parties, with additional post-release mitigations to help address residual risks:
117
+ 1. Pre-training mitigation. We filtered pre-training data for multiple categories of “not safe for work” (NSFW) and known child sexual abuse material (CSAM) to help prevent a user generating unlawful content in response to text prompts or uploaded images. We have partnered with the Internet Watch Foundation, an independent nonprofit organization dedicated to preventing online abuse, to filter known CSAM from the training data.
118
+ 2. Post-training mitigation. Subsequently, we undertook multiple rounds of targeted fine-tuning to provide additional mitigation against potential abuse, including both text-to-image (T2I) and image-to-image (I2I) attacks. By inhibiting certain behaviors and suppressing certain concepts in the trained model, these techniques can help to prevent a user generating synthetic CSAM or NCII from a text prompt, or transforming an uploaded image into synthetic CSAM or NCII.
119
+ 3. Ongoing evaluation. Throughout this process, we conducted multiple internal and external third-party evaluations of model checkpoints to identify further opportunities for mitigation. External third-party evaluations focused on eliciting CSAM and NCII through adversarial testing with (i) text-only prompts, (ii) a single uploaded reference image with text prompts, and (iii) multiple uploaded reference images with text prompts. Based on this feedback, we conducted further safety fine-tuning to produce our open-weight model (FLUX.2 [dev]).
120
+ 4. Release decision. After safety fine-tuning and prior to release, we conducted a final third-party evaluation of the proposed release checkpoint, focused on T2I and I2I generation of synthetic CSAM and NCII, including a comparison with other open-weight T2I and I2I models (total prompts n≈2,800). The final FLUX.2 [dev] checkpoint demonstrated high resilience against violative inputs in complex generation and editing tasks, and demonstrated higher resilience than leading open-weight models across these risk categories. Based on these findings, we approved the release of the FLUX.2 Pro model via API and the release of the open-weight FLUX.2 [dev] model under a non-commercial license to support third-party research and development.
121
+ 5. Inference filters. The repository for the FLUX.2 [dev] model includes filters for NSFW and IP-infringing content at input and output. Filters or manual review must be used with the model under the terms of the FLUX.2 [dev] Non-Commercial License. We may approach known deployers of the FLUX.2 [dev] model at random to verify that filters or manual review processes are in place. Additionally, we apply multiple filters to intercept text prompts, uploaded images, and output images on the API for FLUX.2 [pro]. We utilize both in-house and third-party supplied filters to prevent CSAM and NCII outputs, including filters provided by Hive and Microsoft. We provide filters for other categories of potentially harmful content, including gore, which can be adjusted by developers based on their specific risk profile and legitimate use cases.
122
+ 6. Content provenance. Content provenance features can help users and platforms better identify, label, and interpret AI-generated content online. The inference code for FLUX.2 [dev] implements an example of pixel-layer watermarking, and this repository includes links to the Coalition for Content Provenance and Authenticity (C2PA) standard for metadata. The API for FLUX.2 Pro applies cryptographically-signed C2PA metadata to output content to indicate that images were produced with our model.
123
+ 7. Policies. Use of our models and access to our API are governed by our FLUX [dev] Non-Commercial License (for our non-commercial open-weight users); Developer Terms of Service, Self-Hosted Commercial License Terms, and Usage Policy (for our commercial open-weight model users); and Developer Terms of Service, FLUX API Service Terms, and Usage Policy (for our API users). These prohibit the generation of unlawful content or the use of generated content for unlawful, defamatory, or abusive purposes. Developers and users must consent to these conditions to access the FLUX.2 [dev] model on Hugging Face.
124
+ 8. Monitoring. We are monitoring for patterns of violative use after release. We continue to issue and escalate takedown requests to websites, services, or businesses that misuse our models. Additionally, we may ban users or developers who we detect intentionally and repeatedly violate our policies via the FLUX API. Additionally, we provide a dedicated email address (safety@blackforestlabs.ai) to solicit feedback from the community. We maintain a reporting relationship with organizations such as the Internet Watch Foundation and the National Center for Missing and Exploited Children, and welcome ongoing engagement with authorities, developers, and researchers to share intelligence about emerging risks and develop effective mitigations.
125
+
126
+
127
+ # License
128
+ This model falls under the [FLUX \[dev\] Non-Commercial License](https://huggingface.co/black-forest-labs/FLUX.2-dev/blob/main/LICENSE.txt).
129
+
flux2-dev-BF16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98cdfcb10d6ed5a860f7169fb234138560cda4af158a70848d155d203f0acac4
3
+ size 64446616544
flux2-dev-F16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:355b3b0810839c9ad8ffcbb9c6a9ac8493c050e6b4d0c89460cb40829a53ced4
3
+ size 64446616544
flux2-dev-Q2_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcbae186d445c80b216387bb596179813f5c9d480e22c820750b6a04be1fb20d
3
+ size 12858250208
flux2-dev-Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b87c506ae8f0b27a4241887969c1b62b12890592fd08da787249bba777120864
3
+ size 15886406624
flux2-dev-Q3_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8a029f5dabde29c45fb6958585b6146855c463f7ced915f159585c4441dcf5e
3
+ size 15886406624
flux2-dev-Q3_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a626549d7c5a099260c5699e6e385ea959c039cf09531cb1caece0af000f77b
3
+ size 15649297376
flux2-dev-Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b750825b6fab2fd491e911d5f99f11e8f3efc9cbf8a2b1225293d26af9c0090a
3
+ size 19299128288
flux2-dev-Q4_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cec0f4f131e23c013f1d749e6688005babeee5acf37493bfaaf6c06b73ef9d5
3
+ size 21262062560
flux2-dev-Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4bd0738c4a4da10ac3ee61fbb6a3af66657cc50e25c6bbacf1cfc818f8bbcd8a
3
+ size 20019893216
flux2-dev-Q4_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99f19dd46961dcbb185c72d962d34ea8c00488a9b6da0ee5e21dbf1899d863e7
3
+ size 19789861856
flux2-dev-Q5_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d0e70190be3b8d0ee6dd8103694653823f7a25454044ca872913343b11bdd49
3
+ size 23224996832
flux2-dev-Q5_1.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6bf0606386ca72720b453396f198a7150cf1a57a7ac408373ebeca65c2e02600
3
+ size 25187931104
flux2-dev-Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da8438ae213aa141cec9803551af576abb678715a2d92c9a14712c8692f9908d
3
+ size 23926887392
flux2-dev-Q5_K_S.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0b01a8577ce4376b65970282238b08af24c0c77327edecc86b26886691bf5db
3
+ size 23746401248
flux2-dev-Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a662e0303d65b7da4741c7bc54bbccd4d7fc17b23e71ced36d177467f4a0ef1
3
+ size 27396232160
flux2-dev-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09d005300dd8dcbbd489bb75ada6254145c84c2c9c3d7cc1829e3c5dedcb42ce
3
+ size 35002602464
teaser_editing.png ADDED

Git LFS Details

  • SHA256: c6c1aa92b4b4a3b61f43c42e3d7aa0a6c29d1a6ce150b0a17282a40ec119acdc
  • Pointer size: 133 Bytes
  • Size of remote file: 11.3 MB
teaser_generation.png ADDED

Git LFS Details

  • SHA256: 4df742c27729c240828ca676401f9bbee20ce1baa1b8868b7e50ead7f837d61a
  • Pointer size: 133 Bytes
  • Size of remote file: 23.3 MB