animrods commited on
Commit
d47a7cb
·
verified ·
1 Parent(s): 2eb0286

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +129 -0
README.md ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: bria-2.3
4
+ license_link: https://bria.ai/bria-huggingface-model-license-agreement/
5
+ inference: false
6
+
7
+ tags:
8
+ - text-to-image
9
+ - legal liability
10
+ - commercial use
11
+ - ip-adapter
12
+ extra_gated_description: >-
13
+ BRIA 2.3 IP-Adapter requires access to BRIA 2.3
14
+ Text-to-Image model
15
+ extra_gated_heading: Fill in this form to get access
16
+ extra_gated_fields:
17
+ Name:
18
+ type: text
19
+ Company/Org name:
20
+ type: text
21
+ Org Type (Early/Growth Startup, Enterprise, Academy):
22
+ type: text
23
+ Role:
24
+ type: text
25
+ Country:
26
+ type: text
27
+ Email:
28
+ type: text
29
+ By submitting this form, I agree to BRIA’s Privacy policy and Terms & conditions, see links below:
30
+ type: checkbox
31
+ ---
32
+
33
+ # BRIA 2.3 Image-Prompt
34
+
35
+ BRIA 2.3 Image-Prompt enables the generation of high-quality images guided by an image as input, alongside (or instead of) the textual prompt. This allows for the creation of images inspired by the content or style of an existing images, which can be useful for the creation of image variations or for transferring the style or content of an image. This module uses the architecture of [IP-Adapter-Plus](https://huggingface.co/papers/2308.06721) and is trained on the foundation of [BRIA 2.3 Text-to-Image](https://huggingface.co/briaai/BRIA-2.3).
36
+
37
+ This adapter can be used in combination with other adapters trained over our foundation model, such as [ControlNet-Depth](briaai/BRIA-2.3-ControlNet-Depth) or [ControlNet-Canny](briaai/BRIA-2.3-ControlNet-Canny).
38
+
39
+
40
+ Similar to [BRIA 2.3](https://huggingface.co/briaai/BRIA-2.3), this adapter was trained from scratch exclusively on licensed data from our data partners. Therefore, it is safe for commercial use and provide full legal liability coverage for copyright and privacy infringement, as well as harmful content mitigation. That is, our dataset does not contain copyrighted materials, such as fictional characters, logos, trademarks, public figures, harmful content, or privacy-infringing content.
41
+
42
+
43
+ #### Image Variations:
44
+ ![Image Variations](https://huggingface.co/briaai/Image-Prompt-BETA/resolve/main/examples/image_variations.png)
45
+ #### Style Transfer (textual prompt: "Paris, high quality"):
46
+ ![Style Transfer](https://huggingface.co/briaai/Image-Prompt-BETA/resolve/main/examples/style_transfer.png)
47
+
48
+ ### Model Description
49
+
50
+ - **Developed by:** BRIA AI
51
+ - **Model type:** [IP-Adapter](https://huggingface.co/docs/diffusers/using-diffusers/ip_adapter) for Latent diffusion
52
+ - **License:** [Commercial licensing terms & conditions.](https://bria.ai/customer-general-terms-and-conditions)
53
+
54
+ - **Model Description:** IP-Adapter for BRIA 2.3 Text-to-Image model. The model generates images guided by an image prompt.
55
+ - **Resources for more information:** [BRIA AI](https://bria.ai/)
56
+
57
+ Bria AI licenses the foundation model on which this model was trained, with full legal liability coverage. Our dataset does not contain copyrighted materials, such as fictional characters, logos, trademarks, public figures, harmful content, or privacy-infringing content.
58
+ For more information, please visit our [website](https://bria.ai/).
59
+
60
+ ### Get Access
61
+ Interested in BRIA 2.3? Purchase is required to license and access BRIA 2.3, ensuring royalty management with our data partners and full liability coverage for commercial use.
62
+
63
+ Are you a startup or a student? We encourage you to apply for our [Startup Program](https://pages.bria.ai/the-visual-generative-ai-platform-for-builders-startups-plan?_gl=1*cqrl81*_ga*MTIxMDI2NzI5OC4xNjk5NTQ3MDAz*_ga_WRN60H46X4*MTcwOTM5OTMzNC4yNzguMC4xNzA5Mzk5MzM0LjYwLjAuMA..) to request access. This program are designed to support emerging businesses and academic pursuits with our cutting-edge technology.
64
+
65
+ Contact us today to unlock the potential of BRIA 2.3! By submitting the form above, you agree to BRIA’s [Privacy policy](https://bria.ai/privacy-policy/) and [Terms & conditions](https://bria.ai/terms-and-conditions/).
66
+
67
+ ### Code example using Diffusers
68
+
69
+ ```
70
+ pip install diffusers
71
+ ```
72
+
73
+
74
+ ```py
75
+ from diffusers import AutoPipelineForText2Image
76
+ from diffusers.utils import load_image
77
+ import torch
78
+
79
+ pipeline = AutoPipelineForText2Image.from_pretrained("briaai/BRIA-2.3", torch_dtype=torch.float16, force_zeros_for_empty_prompt=False).to("cuda")
80
+ pipeline.load_ip_adapter("briaai/Image-Prompt", subfolder='models', weight_name="ip_adapter_bria.bin")
81
+
82
+ ```
83
+ ## Create variations of the input image
84
+ ```py
85
+ pipeline.set_ip_adapter_scale(1.0)
86
+ image = load_image("examples/example1.jpg")
87
+ generator = torch.Generator(device="cpu").manual_seed(0)
88
+ images = pipeline(
89
+ prompt="high quality",
90
+ ip_adapter_image=image.resize((224, 224)),
91
+ num_inference_steps=50,
92
+ generator=generator,
93
+ height=1024, width=1024
94
+ ).images
95
+ images[0]
96
+ ```
97
+
98
+ ## Use both image and textual prompt as inputs
99
+ ```py
100
+ textual_prompt = "Paris, high quality"
101
+ pipeline.set_ip_adapter_scale(0.8)
102
+ image = load_image("examples/example2.jpg")
103
+ generator = torch.Generator(device="cpu").manual_seed(0)
104
+ images = pipeline(
105
+ prompt=textual_prompt,
106
+ ip_adapter_image=image.resize((224, 224)),
107
+ num_inference_steps=50,
108
+ generator=generator,
109
+ height=1024, width=1024,
110
+ guidance_scale=7
111
+ ).images
112
+ images[0]
113
+ ```
114
+
115
+
116
+
117
+
118
+
119
+
120
+ ### Some tips for using our text-to-image model at inference:
121
+
122
+
123
+ 1. You must set `pipe.force_zeros_for_empty_prompt = False`
124
+ 2. For image variations, you can try setting an empty prompt. Also, you can add a negative prompt.
125
+ 3. We support multiple aspect ratios, yet resolution should overall consists approximately `1024*1024=1M` pixels, for example:
126
+ `(1024,1024), (1280, 768), (1344, 768), (832, 1216), (1152, 832), (1216, 832), (960,1088)`
127
+ 4. Change the scale of the ip-adapter by using the "set_ip_adapter_scale()" method (range 0-1). The higher the scale, the closer the output will be to the input image.
128
+ 5. Resize the input image into a square, otherwise the CLIP image embedder will perform center-crop.
129
+