lora-finetuning-guide / index.html
Bar-Fin's picture
Upload 2 files
b874bdf verified
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>[Bria-LoRa-FineTune]</title><style>
/* cspell:disable-file */
/* webkit printing magic: print all background colors */
html {
-webkit-print-color-adjust: exact;
}
* {
box-sizing: border-box;
-webkit-print-color-adjust: exact;
}
html,
body {
margin: 0;
padding: 0;
}
@media only screen {
body {
margin: 2em auto;
max-width: 900px;
color: rgb(55, 53, 47);
}
}
body {
line-height: 1.5;
white-space: pre-wrap;
}
a,
a.visited {
color: inherit;
text-decoration: underline;
}
.pdf-relative-link-path {
font-size: 80%;
color: #444;
}
h1,
h2,
h3 {
letter-spacing: -0.01em;
line-height: 1.2;
font-weight: 600;
margin-bottom: 0;
}
.page-title {
font-size: 2.5rem;
font-weight: 700;
margin-top: 0;
margin-bottom: 0.75em;
}
h1 {
font-size: 1.875rem;
margin-top: 1.875rem;
}
h2 {
font-size: 1.5rem;
margin-top: 1.5rem;
}
h3 {
font-size: 1.25rem;
margin-top: 1.25rem;
}
.source {
border: 1px solid #ddd;
border-radius: 3px;
padding: 1.5em;
word-break: break-all;
}
.callout {
border-radius: 3px;
padding: 1rem;
}
figure {
margin: 1.25em 0;
page-break-inside: avoid;
}
figcaption {
opacity: 0.5;
font-size: 85%;
margin-top: 0.5em;
}
mark {
background-color: transparent;
}
.indented {
padding-left: 1.5em;
}
hr {
background: transparent;
display: block;
width: 100%;
height: 1px;
visibility: visible;
border: none;
border-bottom: 1px solid rgba(55, 53, 47, 0.09);
}
img {
max-width: 100%;
}
@media only print {
img {
max-height: 100vh;
object-fit: contain;
}
}
@page {
margin: 1in;
}
.collection-content {
font-size: 0.875rem;
}
.column-list {
display: flex;
justify-content: space-between;
}
.column {
padding: 0 1em;
}
.column:first-child {
padding-left: 0;
}
.column:last-child {
padding-right: 0;
}
.table_of_contents-item {
display: block;
font-size: 0.875rem;
line-height: 1.3;
padding: 0.125rem;
}
.table_of_contents-indent-1 {
margin-left: 1.5rem;
}
.table_of_contents-indent-2 {
margin-left: 3rem;
}
.table_of_contents-indent-3 {
margin-left: 4.5rem;
}
.table_of_contents-link {
text-decoration: none;
opacity: 0.7;
border-bottom: 1px solid rgba(55, 53, 47, 0.18);
}
table,
th,
td {
border: 1px solid rgba(55, 53, 47, 0.09);
border-collapse: collapse;
}
table {
border-left: none;
border-right: none;
}
th,
td {
font-weight: normal;
padding: 0.25em 0.5em;
line-height: 1.5;
min-height: 1.5em;
text-align: left;
}
th {
color: rgba(55, 53, 47, 0.6);
}
ol,
ul {
margin: 0;
margin-block-start: 0.6em;
margin-block-end: 0.6em;
}
li > ol:first-child,
li > ul:first-child {
margin-block-start: 0.6em;
}
ul > li {
list-style: disc;
}
ul.to-do-list {
padding-inline-start: 0;
}
ul.to-do-list > li {
list-style: none;
}
.to-do-children-checked {
text-decoration: line-through;
opacity: 0.375;
}
ul.toggle > li {
list-style: none;
}
ul {
padding-inline-start: 1.7em;
}
ul > li {
padding-left: 0.1em;
}
ol {
padding-inline-start: 1.6em;
}
ol > li {
padding-left: 0.2em;
}
.mono ol {
padding-inline-start: 2em;
}
.mono ol > li {
text-indent: -0.4em;
}
.toggle {
padding-inline-start: 0em;
list-style-type: none;
}
/* Indent toggle children */
.toggle > li > details {
padding-left: 1.7em;
}
.toggle > li > details > summary {
margin-left: -1.1em;
}
.selected-value {
display: inline-block;
padding: 0 0.5em;
background: rgba(206, 205, 202, 0.5);
border-radius: 3px;
margin-right: 0.5em;
margin-top: 0.3em;
margin-bottom: 0.3em;
white-space: nowrap;
}
.collection-title {
display: inline-block;
margin-right: 1em;
}
.page-description {
margin-bottom: 2em;
}
.simple-table {
margin-top: 1em;
font-size: 0.875rem;
empty-cells: show;
}
.simple-table td {
height: 29px;
min-width: 120px;
}
.simple-table th {
height: 29px;
min-width: 120px;
}
.simple-table-header-color {
background: rgb(247, 246, 243);
color: black;
}
.simple-table-header {
font-weight: 500;
}
time {
opacity: 0.5;
}
.icon {
display: inline-block;
max-width: 1.2em;
max-height: 1.2em;
text-decoration: none;
vertical-align: text-bottom;
margin-right: 0.5em;
}
img.icon {
border-radius: 3px;
}
.user-icon {
width: 1.5em;
height: 1.5em;
border-radius: 100%;
margin-right: 0.5rem;
}
.user-icon-inner {
font-size: 0.8em;
}
.text-icon {
border: 1px solid #000;
text-align: center;
}
.page-cover-image {
display: block;
object-fit: cover;
width: 100%;
max-height: 30vh;
}
.page-header-icon {
font-size: 3rem;
margin-bottom: 1rem;
}
.page-header-icon-with-cover {
margin-top: -0.72em;
margin-left: 0.07em;
}
.page-header-icon img {
border-radius: 3px;
}
.link-to-page {
margin: 1em 0;
padding: 0;
border: none;
font-weight: 500;
}
p > .user {
opacity: 0.5;
}
td > .user,
td > time {
white-space: nowrap;
}
input[type="checkbox"] {
transform: scale(1.5);
margin-right: 0.6em;
vertical-align: middle;
}
p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.image {
border: none;
margin: 1.5em 0;
padding: 0;
border-radius: 0;
text-align: center;
}
.code,
code {
background: rgba(135, 131, 120, 0.15);
border-radius: 3px;
padding: 0.2em 0.4em;
border-radius: 3px;
font-size: 85%;
tab-size: 2;
}
code {
color: #eb5757;
}
.code {
padding: 1.5em 1em;
}
.code-wrap {
white-space: pre-wrap;
word-break: break-all;
}
.code > code {
background: none;
padding: 0;
font-size: 100%;
color: inherit;
}
blockquote {
font-size: 1.25em;
margin: 1em 0;
padding-left: 1em;
border-left: 3px solid rgb(55, 53, 47);
}
.bookmark {
text-decoration: none;
max-height: 8em;
padding: 0;
display: flex;
width: 100%;
align-items: stretch;
}
.bookmark-title {
font-size: 0.85em;
overflow: hidden;
text-overflow: ellipsis;
height: 1.75em;
white-space: nowrap;
}
.bookmark-text {
display: flex;
flex-direction: column;
}
.bookmark-info {
flex: 4 1 180px;
padding: 12px 14px 14px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.bookmark-image {
width: 33%;
flex: 1 1 180px;
display: block;
position: relative;
object-fit: cover;
border-radius: 1px;
}
.bookmark-description {
color: rgba(55, 53, 47, 0.6);
font-size: 0.75em;
overflow: hidden;
max-height: 4.5em;
word-break: break-word;
}
.bookmark-href {
font-size: 0.75em;
margin-top: 0.25em;
}
.sans { font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol"; }
.code { font-family: "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace; }
.serif { font-family: Lyon-Text, Georgia, ui-serif, serif; }
.mono { font-family: iawriter-mono, Nitti, Menlo, Courier, monospace; }
.pdf .sans { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", 'Twemoji', 'Noto Color Emoji', 'Noto Sans CJK JP'; }
.pdf:lang(zh-CN) .sans { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", 'Twemoji', 'Noto Color Emoji', 'Noto Sans CJK SC'; }
.pdf:lang(zh-TW) .sans { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", 'Twemoji', 'Noto Color Emoji', 'Noto Sans CJK TC'; }
.pdf:lang(ko-KR) .sans { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", 'Twemoji', 'Noto Color Emoji', 'Noto Sans CJK KR'; }
.pdf .code { font-family: Source Code Pro, "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK JP'; }
.pdf:lang(zh-CN) .code { font-family: Source Code Pro, "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK SC'; }
.pdf:lang(zh-TW) .code { font-family: Source Code Pro, "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK TC'; }
.pdf:lang(ko-KR) .code { font-family: Source Code Pro, "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK KR'; }
.pdf .serif { font-family: PT Serif, Lyon-Text, Georgia, ui-serif, serif, 'Twemoji', 'Noto Color Emoji', 'Noto Serif CJK JP'; }
.pdf:lang(zh-CN) .serif { font-family: PT Serif, Lyon-Text, Georgia, ui-serif, serif, 'Twemoji', 'Noto Color Emoji', 'Noto Serif CJK SC'; }
.pdf:lang(zh-TW) .serif { font-family: PT Serif, Lyon-Text, Georgia, ui-serif, serif, 'Twemoji', 'Noto Color Emoji', 'Noto Serif CJK TC'; }
.pdf:lang(ko-KR) .serif { font-family: PT Serif, Lyon-Text, Georgia, ui-serif, serif, 'Twemoji', 'Noto Color Emoji', 'Noto Serif CJK KR'; }
.pdf .mono { font-family: PT Mono, iawriter-mono, Nitti, Menlo, Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK JP'; }
.pdf:lang(zh-CN) .mono { font-family: PT Mono, iawriter-mono, Nitti, Menlo, Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK SC'; }
.pdf:lang(zh-TW) .mono { font-family: PT Mono, iawriter-mono, Nitti, Menlo, Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK TC'; }
.pdf:lang(ko-KR) .mono { font-family: PT Mono, iawriter-mono, Nitti, Menlo, Courier, monospace, 'Twemoji', 'Noto Color Emoji', 'Noto Sans Mono CJK KR'; }
.highlight-default {
color: rgba(55, 53, 47, 1);
}
.highlight-gray {
color: rgba(120, 119, 116, 1);
fill: rgba(120, 119, 116, 1);
}
.highlight-brown {
color: rgba(159, 107, 83, 1);
fill: rgba(159, 107, 83, 1);
}
.highlight-orange {
color: rgba(217, 115, 13, 1);
fill: rgba(217, 115, 13, 1);
}
.highlight-yellow {
color: rgba(203, 145, 47, 1);
fill: rgba(203, 145, 47, 1);
}
.highlight-teal {
color: rgba(68, 131, 97, 1);
fill: rgba(68, 131, 97, 1);
}
.highlight-blue {
color: rgba(51, 126, 169, 1);
fill: rgba(51, 126, 169, 1);
}
.highlight-purple {
color: rgba(144, 101, 176, 1);
fill: rgba(144, 101, 176, 1);
}
.highlight-pink {
color: rgba(193, 76, 138, 1);
fill: rgba(193, 76, 138, 1);
}
.highlight-red {
color: rgba(212, 76, 71, 1);
fill: rgba(212, 76, 71, 1);
}
.highlight-default_background {
color: rgba(55, 53, 47, 1);
}
.highlight-gray_background {
background: rgba(241, 241, 239, 1);
}
.highlight-brown_background {
background: rgba(244, 238, 238, 1);
}
.highlight-orange_background {
background: rgba(251, 236, 221, 1);
}
.highlight-yellow_background {
background: rgba(251, 243, 219, 1);
}
.highlight-teal_background {
background: rgba(237, 243, 236, 1);
}
.highlight-blue_background {
background: rgba(231, 243, 248, 1);
}
.highlight-purple_background {
background: rgba(244, 240, 247, 0.8);
}
.highlight-pink_background {
background: rgba(249, 238, 243, 0.8);
}
.highlight-red_background {
background: rgba(253, 235, 236, 1);
}
.block-color-default {
color: inherit;
fill: inherit;
}
.block-color-gray {
color: rgba(120, 119, 116, 1);
fill: rgba(120, 119, 116, 1);
}
.block-color-brown {
color: rgba(159, 107, 83, 1);
fill: rgba(159, 107, 83, 1);
}
.block-color-orange {
color: rgba(217, 115, 13, 1);
fill: rgba(217, 115, 13, 1);
}
.block-color-yellow {
color: rgba(203, 145, 47, 1);
fill: rgba(203, 145, 47, 1);
}
.block-color-teal {
color: rgba(68, 131, 97, 1);
fill: rgba(68, 131, 97, 1);
}
.block-color-blue {
color: rgba(51, 126, 169, 1);
fill: rgba(51, 126, 169, 1);
}
.block-color-purple {
color: rgba(144, 101, 176, 1);
fill: rgba(144, 101, 176, 1);
}
.block-color-pink {
color: rgba(193, 76, 138, 1);
fill: rgba(193, 76, 138, 1);
}
.block-color-red {
color: rgba(212, 76, 71, 1);
fill: rgba(212, 76, 71, 1);
}
.block-color-default_background {
color: inherit;
fill: inherit;
}
.block-color-gray_background {
background: rgba(241, 241, 239, 1);
}
.block-color-brown_background {
background: rgba(244, 238, 238, 1);
}
.block-color-orange_background {
background: rgba(251, 236, 221, 1);
}
.block-color-yellow_background {
background: rgba(251, 243, 219, 1);
}
.block-color-teal_background {
background: rgba(237, 243, 236, 1);
}
.block-color-blue_background {
background: rgba(231, 243, 248, 1);
}
.block-color-purple_background {
background: rgba(244, 240, 247, 0.8);
}
.block-color-pink_background {
background: rgba(249, 238, 243, 0.8);
}
.block-color-red_background {
background: rgba(253, 235, 236, 1);
}
.select-value-color-uiBlue { background-color: rgba(35, 131, 226, .07); }
.select-value-color-pink { background-color: rgba(245, 224, 233, 1); }
.select-value-color-purple { background-color: rgba(232, 222, 238, 1); }
.select-value-color-green { background-color: rgba(219, 237, 219, 1); }
.select-value-color-gray { background-color: rgba(227, 226, 224, 1); }
.select-value-color-transparentGray { background-color: rgba(227, 226, 224, 0); }
.select-value-color-translucentGray { background-color: rgba(0, 0, 0, 0.06); }
.select-value-color-orange { background-color: rgba(250, 222, 201, 1); }
.select-value-color-brown { background-color: rgba(238, 224, 218, 1); }
.select-value-color-red { background-color: rgba(255, 226, 221, 1); }
.select-value-color-yellow { background-color: rgba(253, 236, 200, 1); }
.select-value-color-blue { background-color: rgba(211, 229, 239, 1); }
.select-value-color-pageGlass { background-color: undefined; }
.select-value-color-washGlass { background-color: undefined; }
.checkbox {
display: inline-flex;
vertical-align: text-bottom;
width: 16;
height: 16;
background-size: 16px;
margin-left: 2px;
margin-right: 5px;
}
.checkbox-on {
background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%2358A9D7%22%2F%3E%0A%3Cpath%20d%3D%22M6.71429%2012.2852L14%204.9995L12.7143%203.71436L6.71429%209.71378L3.28571%206.2831L2%207.57092L6.71429%2012.2852Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E");
}
.checkbox-off {
background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%220.75%22%20y%3D%220.75%22%20width%3D%2214.5%22%20height%3D%2214.5%22%20fill%3D%22white%22%20stroke%3D%22%2336352F%22%20stroke-width%3D%221.5%22%2F%3E%0A%3C%2Fsvg%3E");
}
</style></head><body><article id="6c6ceb0e-c7a0-40e4-b270-a0ecb60585f0" class="page sans"><header><div class="page-header-icon undefined"><span class="icon">🧪</span></div><h1 class="page-title">[Bria-LoRa-FineTune]</h1><p class="page-description"></p></header><div class="page-body"><p id="14aba153-4679-801b-9d09-c9bc7f724332" class="">
</p><figure class="block-color-gray_background callout" style="white-space:pre-wrap;display:flex" id="14aba153-4679-80e7-9d50-d1d96167521b"><div style="font-size:1.5em"><span class="icon">🔥</span></div><div style="width:100%"><blockquote id="787c60fb-a865-470b-b336-fb00c6c4fe47" class="">Join our <strong><a href="https://discord.gg/Nxe9YW9zHS">Discord community</a></strong> for more information, tutorials, tools, and to connect with other users!</blockquote></div></figure><p id="14aba153-4679-8062-9caf-ccedb2789586" class="">
</p><figure class="block-color-gray_background callout" style="white-space:pre-wrap;display:flex" id="149ba153-4679-805d-8668-d0084da9ccdb"><div style="font-size:1.5em"><span class="icon">💡</span></div><div style="width:100%"><p id="5ec2f388-191f-43fb-a4e9-7936b6b74ca4" class="">To use the links below right click on them and open in new tab</p></div></figure><p id="14aba153-4679-8039-a623-d55ebd35fd57" class="">
</p><hr id="14aba153-4679-801c-9f07-d08869a6af98"/><p id="14aba153-4679-80d7-ac11-d55cbb15d1b4" class="">
</p><p id="c5134d7e-62d0-49f9-8400-9149c1e15b74" class="">The following guide demonstrates Bria best practices for fine tuning on top of our foundation models using <a href="https://arxiv.org/abs/2106.09685">Lora</a> architecture and Bria foundation models. </p><p id="149ba153-4679-80f8-8b21-e66259903116" class="">
</p><p id="149ba153-4679-8009-8d4d-cec1e29b4f36" class=""><em>Full implementation of the guide below:</em></p><figure id="149ba153-4679-8039-a947-e04725423506"><a href="https://huggingface.co/spaces/Bar-Fin/lora-sdxl-finetuning/blob/main/lora_finetune.ipynb" class="bookmark source"><div class="bookmark-info"><div class="bookmark-text"><div class="bookmark-title">huggingface.co</div></div><div class="bookmark-href">https://huggingface.co/spaces/Bar-Fin/lora-sdxl-finetuning/blob/main/lora_finetune.ipynb</div></div></a></figure><h1 id="149ba153-4679-80e7-b3c8-d7d65fa2f1e1" class="">Theory</h1><p id="149ba153-4679-8047-b451-efe2b605aa4b" class="">
</p><h3 id="149ba153-4679-8004-8254-e6af55f7f0fa" class="">Dream boot</h3><figure id="149ba153-4679-806b-853c-e20596d0e2fd" class="image"><a href="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image.png"><img style="width:707.9900512695312px" src="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image.png"/></a></figure><p id="149ba153-4679-8074-96c0-e7d508bc1885" class="">is a fine-tuning technique designed to personalize generative models like Stable Diffusion. It allows users to train the model on a small set of images (e.g., photos of a person, object, or style) and integrate the learned concept into the model’s vocabulary.</p><p id="149ba153-4679-8005-9417-c20e761e3d87" class="">
</p><h3 id="149ba153-4679-8018-849a-e5645ced8db1" class="">Lora Architecture vs Regular fine tuning</h3><figure id="149ba153-4679-80fb-8607-f54414a98de5" class="image"><a href="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%201.png"><img style="width:2320px" src="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%201.png"/></a></figure><p id="149ba153-4679-8032-bfbd-e9ab803061f3" class="">LoRA is a technique to efficiently fine-tune large machine learning models by reducing the number of trainable parameters. Instead of updating the full set of model weights during training, LoRA represents weight updates as the product of two smaller matrices (low-rank matrices).</p><p id="149ba153-4679-80f7-a9ff-ebab637d821a" class="">This approach significantly reduces computational and memory requirements while maintaining high performance, making it particularly useful for large-scale models like transformers. LoRA is widely adopted in applications like NLP and computer vision where fine-tuning massive pre-trained models would otherwise be resource-intensive.</p><p id="149ba153-4679-80a1-94c3-f3bb3bffa861" class="">
</p><h3 id="149ba153-4679-8019-9875-d983162064d0" class=""><strong>Stochastic Gradient descent</strong></h3><div id="149ba153-4679-805a-8f15-cc76eeac21d0" class="column-list"><div id="149ba153-4679-80fc-acd8-f7ce273123d0" style="width:50%" class="column"><figure id="149ba153-4679-80e2-b1a2-cbbbaff5563f" class="image"><a href="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/7df06035-f512-4471-8269-6495a9338be2.png"><img style="width:414.0659340659341px" src="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/7df06035-f512-4471-8269-6495a9338be2.png"/></a></figure></div><div id="149ba153-4679-8067-b0fc-ecddc353d7c5" style="width:49.99999999999999%" class="column"><figure id="149ba153-4679-80a1-a685-fe281ceffc7d" class="image"><a href="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%202.png"><img style="width:691.9885864257812px" src="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%202.png"/></a></figure></div></div><p id="149ba153-4679-803d-8f98-c8a7b9eea46e" class=""><strong>Analogy</strong> - Stochastic Gradient Descent (SGD) is like finding the lowest point in a bumpy valley by taking small steps downhill, but instead of looking at the whole valley at once, you only look at one random part of it each time to decide your step.</p><p id="149ba153-4679-80ce-a58a-e80de0278e51" class="">
</p><h3 id="149ba153-4679-800c-9dc7-e608416dad84" class="">The diffusion process </h3><figure id="149ba153-4679-80b1-9b43-f9b479be9763" class="image"><a href="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/Screenshot_2024-11-25_at_10.33.01.png"><img style="width:707.9900512695312px" src="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/Screenshot_2024-11-25_at_10.33.01.png"/></a></figure><p id="5c7f2d4f-7163-4212-831b-8143bd0011a9" class="">
</p><h1 id="16179015-cdb5-4880-acc4-fc450dfabb44" class="">Training script</h1><p id="957774ff-d50f-4f6b-9216-70a5149f7d93" class="">On Bria production we use the standard diffusers code:</p><figure id="2c386060-0fef-479c-9d04-13d4ac948e29"><a href="https://huggingface.co/docs/diffusers/en/training/lora" class="bookmark source"><div class="bookmark-info"><div class="bookmark-text"><div class="bookmark-title">LoRA</div><div class="bookmark-description">We’re on a journey to advance and democratize artificial intelligence through open source and open science.</div></div><div class="bookmark-href"><img src="https://huggingface.co/favicon.ico" class="icon bookmark-icon"/>https://huggingface.co/docs/diffusers/en/training/lora</div></div><img src="https://huggingface.co/front/thumbnails/docs/diffusers.png" class="bookmark-image"/></a></figure><p id="3d9b5316-11c9-4c4f-a2eb-1eaf8dbd5ce4" class="">But recommend evaluating the more advance methods as well</p><ul id="c4e2ab5f-0655-4599-bc45-d98fdd8caf7a" class="bulleted-list"><li style="list-style-type:disc"><a href="https://huggingface.co/blog/sdxl_lora_advanced_script">Pivotal</a></li></ul><ul id="3c42ab6c-e9e8-41d2-bc12-3224edc75b5b" class="bulleted-list"><li style="list-style-type:disc"><a href="https://github.com/NVlabs/DoRA">Dora</a></li></ul><p id="b8a6ef85-efcf-4bf0-98cb-58809effb3b3" class="">
</p><h1 id="1f445c3c-3978-4db4-887e-5dd6f1cffcbb" class="">Recipe </h1><p id="de99a4cf-0b9d-4468-9a57-d19384c4cc94" class="">This is the recommended recipe for our auto trading feature:</p><script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js" integrity="sha512-7Z9J3l1+EYfeaPKcGXu3MS/7T+w19WtKQY/n+xzmw4hZhJ9tyYmcUS+4QqAlzhicE5LAfMQSF3iFTK9bQdTxXg==" crossorigin="anonymous" referrerPolicy="no-referrer"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css" integrity="sha512-tN7Ec6zAFaVSG3TpNAKtk4DOHNpSwKHxxrsiw4GHKESGPs5njn/0sMCUMl2svV4wo4BK/rCP7juYz+zx+l6oeQ==" crossorigin="anonymous" referrerPolicy="no-referrer"/><pre id="814612a2-b242-476b-bc96-6c24ee19e1d5" class="code"><code class="language-Bash">
accelerate launch \
--config_file accelerate_config.yaml \
train_new.py \
--caption_column=&quot;...&quot; \
--pretrained_model_name_or_path=&quot;briaai/BRIA-2.3&quot; \
--dataset_name=$DATASET_NAME \
--resolution=1024 \
--center_crop \
--train_batch_size=1 \
--gradient_accumulation_steps=4 \
--gradient_checkpointing \
--max_train_steps=1000 \
--checkpointing_steps=200 \
--use_8bit_adam \
--learning_rate=1e-04 \
--lr_scheduler=&quot;constant&quot; \
--lr_warmup_steps=0 \
--mixed_precision=&quot;bf16&quot; \
--validation_epochs=5 \
--output_dir=$MODEL_DIR \
--rank=16</code></pre><figure class="block-color-gray_background callout" style="white-space:pre-wrap;display:flex" id="c2c58972-e772-4fb4-9dc0-5ccea1d0598a"><div style="font-size:1.5em"><span class="icon">💡</span></div><div style="width:100%">Using rank 256 consume lots of memory and increase model size, we recommend experimenting with lower ones e.g. 64, 32, 16</div></figure><p id="004fbcbb-eb44-42f7-9556-d2cb6aad42aa" class="">
</p><h1 id="4708ec58-df72-4feb-9719-0dd3ebe5b275" class="">Model</h1><p id="891f9ec4-2e26-4bea-a005-8afed37280da" class="">Use Bria 2.3 as the “go to” model, but if needed our HD can fix quality issues for specific use-cases </p><figure id="2f489514-2d69-441f-8565-617b5092c2dd"><a href="https://huggingface.co/briaai/BRIA-2.3" class="bookmark source"><div class="bookmark-info"><div class="bookmark-text"><div class="bookmark-title">briaai/BRIA-2.3 · Hugging Face</div><div class="bookmark-description">We’re on a journey to advance and democratize artificial intelligence through open source and open science.</div></div><div class="bookmark-href"><img src="https://huggingface.co/favicon.ico" class="icon bookmark-icon"/>https://huggingface.co/briaai/BRIA-2.3</div></div><img src="/static-proxy?url=https%3A%2F%2Fcdn-thumbnails.huggingface.co%2Fsocial-thumbnails%2Fmodels%2Fbriaai%2FBRIA-2.3.png%26quot%3B%3C%2Fspan%3E class="bookmark-image"/></a></figure><p id="e0ce7995-0929-44b8-a2b5-2dc7c95f706a" class="">
</p><h1 id="79baa328-eaec-4027-bd0a-979274090e47" class="">Best practices for Tailored Generation training datasets</h1><ul id="9ab63f9e-c234-4bc3-916f-5c41d51cdb7b" class="bulleted-list"><li style="list-style-type:disc">For general style we usually use 20-100 images </li></ul><ul id="5c4b16a5-28bd-45c6-9be4-80d579a0a323" class="bulleted-list"><li style="list-style-type:disc">For single person / character 10-20</li></ul><h3 id="149ba153-4679-801f-b69a-fbe417a57072" class="">Dataset description</h3><p id="149ba153-4679-80bd-b9ff-e862178b73db" class="">Enhance training performance by providing a concise and clear description of your style or subject.</p><ul id="149ba153-4679-807d-a006-eb92b084def1" class="bulleted-list"><li style="list-style-type:disc">Aim to produce results that align with the style of the base model you&#x27;re training on</li></ul><ul id="149ba153-4679-8073-aec2-d67ef168260c" class="bulleted-list"><li style="list-style-type:disc">Be brief and accurate and avoid excessive explanations about the style. Instead, use a few, well-chosen words that succinctly capture its essence, either through widely recognized concepts or by directly naming it.</li></ul><p id="149ba153-4679-809b-bc7b-e1b55918ef32" class="">Examples of dataset descriptions:</p><div id="149ba153-4679-80c6-aa35-d317666c70b3" class="column-list"><div id="149ba153-4679-81a9-91e6-e529b71427df" style="width:25%" class="column"><figure id="149ba153-4679-8145-aabd-db0bd803d43b" class="image"><a href="https://platform.bria.ai/assets/Flat%20vector%20illustration-ec3b592a.png"><img style="width:427.99713134765625px" src="https://platform.bria.ai/assets/Flat%20vector%20illustration-ec3b592a.png"/></a><figcaption>Flat vector illustration</figcaption></figure></div><div id="149ba153-4679-8109-a292-e57d5a4e1acc" style="width:25%" class="column"><figure id="149ba153-4679-8110-b880-d08ddc68c50d" class="image"><a href="https://platform.bria.ai/assets/3D%20render-a2445206.png"><img style="width:213.99856567382812px" src="https://platform.bria.ai/assets/3D%20render-a2445206.png"/></a><figcaption>3D render</figcaption></figure></div><div id="149ba153-4679-8113-b05c-cdf3e77dc292" style="width:25%" class="column"><figure id="149ba153-4679-816f-a8ca-d52997748698" class="image"><a href="https://platform.bria.ai/assets/Water%20Color-1b559c2c.png"><img style="width:213.99856567382812px" src="https://platform.bria.ai/assets/Water%20Color-1b559c2c.png"/></a><figcaption>Water Color</figcaption></figure></div><div id="149ba153-4679-810b-8644-dd8aa4e05998" style="width:25%" class="column"><figure id="149ba153-4679-818d-8cc0-c658b9604a22" class="image"><a href="https://platform.bria.ai/assets/Pixel%20game%20art-df7ebe1b.png"><img style="width:213.99856567382812px" src="https://platform.bria.ai/assets/Pixel%20game%20art-df7ebe1b.png"/></a><figcaption>Pixel game art</figcaption></figure></div></div><p id="149ba153-4679-80e0-869f-c372bf187d36" class=""><strong>Style</strong></p><p id="149ba153-4679-8015-86ca-f7b0aa5279a3" class="">When training a model for a specific style type, it is crucial to provide images that contain the right information to guide the model. You should use around 20-60 images, and the dataset should consist of a clear style within a specific domain.</p><p id="149ba153-4679-8071-b813-d7312ed7edc8" class="">The images in your dataset should consider multiple perspectives and the appropriate background styles you aim to create.</p><p id="149ba153-4679-80aa-8ba2-dcdc313828d9" class="">
</p><p id="149ba153-4679-808f-9082-e4e2ebb2d82d" class=""><strong>Examples of common use cases:</strong></p><p id="149ba153-4679-8000-8916-f91b289787e8" class="">
</p><p id="149ba153-4679-80bb-b8cf-f90ca7da9c34" class=""><strong>Share the same style:</strong></p><p id="149ba153-4679-802c-a37f-e97b26c49e53" class="">Datasets can include a wide range of variations as long as they share the same artistic style.</p><div id="149ba153-4679-8049-871b-df737405c5b5" class="column-list"><div id="149ba153-4679-81ca-812c-c52980664bf1" style="width:33.333333333333336%" class="column"><figure id="149ba153-4679-81f8-b1bb-e7a1ce379eae" class="image"><a href="https://platform.bria.ai/assets/Share%20the%20same%20style_3-cd431a1b.png"><img style="width:160px" src="https://platform.bria.ai/assets/Share%20the%20same%20style_3-cd431a1b.png"/></a></figure></div><div id="149ba153-4679-81e6-a310-e980e76e6b45" style="width:33.333333333333336%" class="column"><figure id="149ba153-4679-81e5-bfa8-ebb1c020f5f1" class="image"><a href="https://platform.bria.ai/assets/Share%20the%20same%20style_2-f270d0a7.png"><img style="width:160px" src="https://platform.bria.ai/assets/Share%20the%20same%20style_2-f270d0a7.png"/></a></figure></div><div id="149ba153-4679-8151-ab16-cd7b47ebb412" style="width:33.33333333333333%" class="column"><figure id="149ba153-4679-8180-b786-e2d9f803ab51" class="image"><a href="https://platform.bria.ai/assets/Share%20the%20same%20style_1-09893066.png"><img style="width:160px" src="https://platform.bria.ai/assets/Share%20the%20same%20style_1-09893066.png"/></a></figure></div></div><hr id="149ba153-4679-805e-ada4-d3bfd7b7c3f0"/><p id="149ba153-4679-807f-9415-e015b07c4c3c" class="">
</p><p id="149ba153-4679-805e-b96f-dafb54b33b35" class=""><strong>Mixing image styles may lead to poor results.</strong></p><p id="149ba153-4679-80df-bbac-d5642022bf7d" class="">Ensure your dataset contains images with uniform style, including color schemes and design techniques, to achieve the desired outcomes from the model.</p><div id="149ba153-4679-8046-8a86-ed8b80087fce" class="column-list"><div id="149ba153-4679-81a7-8fe1-f53a1729d8c9" style="width:33.333333333333336%" class="column"><figure id="149ba153-4679-81de-9d38-ece53929ba6c" class="image"><a href="https://platform.bria.ai/assets/Mixing%20image%20styles%20may%20lead%20to%20poor%20results.-8b64818f.png"><img style="width:160px" src="https://platform.bria.ai/assets/Mixing%20image%20styles%20may%20lead%20to%20poor%20results.-8b64818f.png"/></a></figure></div><div id="149ba153-4679-8167-9476-edfb8f3c4040" style="width:33.333333333333336%" class="column"><figure id="149ba153-4679-81e2-9b00-f4de31cbd092" class="image"><a href="https://platform.bria.ai/assets/Mixing%20image%20styles%20may%20lead%20to%20poor%20results.2-af516ada.png"><img style="width:160px" src="https://platform.bria.ai/assets/Mixing%20image%20styles%20may%20lead%20to%20poor%20results.2-af516ada.png"/></a></figure></div><div id="149ba153-4679-814b-b3d8-dd16ecadc6bb" style="width:33.33333333333333%" class="column"><figure id="149ba153-4679-81fa-a662-c8a32400eaef" class="image"><a href="https://platform.bria.ai/assets/Mixing%20image%20styles%20may%20lead%20to%20poor%20results.3-842f30b9.png"><img style="width:160px" src="https://platform.bria.ai/assets/Mixing%20image%20styles%20may%20lead%20to%20poor%20results.3-842f30b9.png"/></a></figure></div></div><p id="149ba153-4679-809e-850e-fb1768552c40" class="">
</p><hr id="149ba153-4679-802b-9d07-c63599e2a9d2"/><p id="149ba153-4679-80bc-ad14-f873397b0e54" class="">
</p><h3 id="149ba153-4679-805f-96c9-daa7fc0cd39a" class="">Single subject</h3><p id="149ba153-4679-802e-a285-d89a716707de" class="">When training a model for a single-subject type, it is essential to provide images that include the right information to guide the model. The dataset should contain 10-20 images and should consist of a single subject type, such as a person, car, bottle, animated character, etc.</p><p id="149ba153-4679-8051-b03a-dee61f23c6b1" class="">The images in your dataset should consider multiple perspectives and the appropriate background styles you aim to create.</p><p id="149ba153-4679-802f-977c-ea38c8b08354" class="">
</p><p id="149ba153-4679-8014-9da7-c8310f2afa69" class=""><strong>Here are some examples that demonstrate common use cases:</strong></p><p id="149ba153-4679-801c-a2dc-cc74df09c437" class="">
</p><p id="149ba153-4679-804d-bfd6-ec6db501e374" class=""><strong>Multi-Perspective</strong></p><div id="149ba153-4679-80c4-98f1-f59ff8eb0807" class="column-list"><div id="149ba153-4679-803e-98f9-db8d44f9fe86" style="width:43.75%" class="column"><p id="149ba153-4679-80de-aa32-faec971739fa" class="">If you aim for your model to generate images of a single subject from various angles or perspectives, ensure your dataset includes examples showcasing these perspectives.</p></div><div id="149ba153-4679-808e-81d9-dc964b6a6402" style="width:18.75%" class="column"><figure id="149ba153-4679-8131-b5a7-ecc74ef6d2d4" class="image"><a href="https://platform.bria.ai/assets/Multi-Perspective-e2223101.png"><img style="width:142.49288940429688px" src="https://platform.bria.ai/assets/Multi-Perspective-e2223101.png"/></a></figure><p id="149ba153-4679-801d-8f92-c3f26f4d179b" class="">
</p></div><div id="149ba153-4679-80c9-a3f3-e06fdf2e9472" style="width:18.750000000000004%" class="column"><figure id="149ba153-4679-8117-a11a-ef67682d55ea" class="image"><a href="https://platform.bria.ai/assets/Multi-Perspective2-836652f7.png"><img style="width:142.49288940429688px" src="https://platform.bria.ai/assets/Multi-Perspective2-836652f7.png"/></a></figure></div><div id="149ba153-4679-80d7-a90b-edcf5635333e" style="width:18.750000000000004%" class="column"><figure id="149ba153-4679-81d1-b684-cdf6692a5b35" class="image"><a href="https://platform.bria.ai/assets/Multi-Perspective3-7cfbe728.png"><img style="width:142.49288940429688px" src="https://platform.bria.ai/assets/Multi-Perspective3-7cfbe728.png"/></a></figure></div></div><hr id="149ba153-4679-80d9-aa82-c848e041749b"/><p id="149ba153-4679-8016-8c00-dad1ffc41f5f" class=""><strong>Incorporating Backgrounds:</strong></p><div id="149ba153-4679-80fc-8abb-d72aa5c9bb68" class="column-list"><div id="149ba153-4679-80f5-a5cd-eb9eebe4ae25" style="width:43.75%" class="column"><p id="149ba153-4679-8067-bcd8-f679e34001f7" class="">Should you desire your model not only to capture the subject but also to learn and replicate the surrounding scenery accurately, it&#x27;s crucial to include images with backgrounds in your dataset. This approach allows the model to understand how the subject interacts with its environment, enabling it to generate more contextually rich images.</p></div><div id="149ba153-4679-80c4-8a21-d91c60d5e00f" style="width:18.75%" class="column"><figure id="149ba153-4679-813c-a169-f60f13bcadb1" class="image"><a href="https://platform.bria.ai/assets/Incorporating%20Backgrounds_-2-3e29cfb6.png"><img style="width:142.49288940429688px" src="https://platform.bria.ai/assets/Incorporating%20Backgrounds_-2-3e29cfb6.png"/></a></figure><p id="149ba153-4679-80f5-8583-ece7e337a633" class="">
</p></div><div id="149ba153-4679-80ce-9882-cd8f1af9906d" style="width:18.749999999999996%" class="column"><figure id="149ba153-4679-81d8-9286-fea0c9c2c11f" class="image"><a href="https://platform.bria.ai/assets/Incorporating%20Backgrounds_-1-9d7beb25.png"><img style="width:155.03550720214844px" src="https://platform.bria.ai/assets/Incorporating%20Backgrounds_-1-9d7beb25.png"/></a></figure></div><div id="149ba153-4679-80e0-94b1-f7765e0ed6e7" style="width:18.75%" class="column"><figure id="149ba153-4679-816c-b9fd-cb63f483204d" class="image"><a href="https://platform.bria.ai/assets/Incorporating%20Backgrounds_-8f4373c4.png"><img style="width:142.49288940429688px" src="https://platform.bria.ai/assets/Incorporating%20Backgrounds_-8f4373c4.png"/></a></figure></div></div><hr id="149ba153-4679-803a-9cd1-de2fb0bcb143"/><p id="149ba153-4679-804f-8339-f52118d68f6d" class=""><strong>Transparent or solid background:</strong></p><div id="149ba153-4679-80be-be8e-ee10740b41a6" class="column-list"><div id="149ba153-4679-80f2-b6d2-fd352477e59a" style="width:43.75%" class="column"><p id="149ba153-4679-8022-bee1-dc25ce5f5362" class="">In cases where the subject is presented against a background of transparent or solid colors (such as white, black, blue, etc.), it is essential to ensure that the subject covers most of the image size. If necessary, it is better to crop the solid margins of the image to reduce the amount of transparency or solid color present.</p></div><div id="149ba153-4679-80cc-bee7-f51ef3554305" style="width:18.749999999999993%" class="column"><figure id="149ba153-4679-812f-9612-dbbaeef240a7" class="image"><a href="https://platform.bria.ai/assets/Transparent%20or%20solid%20background_3-eff802b3.png"><img style="width:142.49288940429688px" src="https://platform.bria.ai/assets/Transparent%20or%20solid%20background_3-eff802b3.png"/></a></figure></div><div id="149ba153-4679-80bd-9538-d9cd927956bc" style="width:18.75%" class="column"><figure id="149ba153-4679-815b-85b7-fcd0717e1c2c" class="image"><a href="https://platform.bria.ai/assets/Transparent%20or%20solid%20background_2-c6c103e8.png"><img style="width:160.9943084716797px" src="https://platform.bria.ai/assets/Transparent%20or%20solid%20background_2-c6c103e8.png"/></a></figure></div><div id="149ba153-4679-8058-8f25-f86048c7eae3" style="width:18.749999999999996%" class="column"><figure id="149ba153-4679-811e-a25d-c2e423d07a0b" class="image"><a href="https://platform.bria.ai/assets/Transparent%20or%20solid%20background_-04b520b5.png"><img style="width:142.49288940429688px" src="https://platform.bria.ai/assets/Transparent%20or%20solid%20background_-04b520b5.png"/></a></figure></div></div><hr id="149ba153-4679-8099-8f67-d210d474e908"/><p id="149ba153-4679-80ae-a0ac-d44a38c8b1de" class=""><strong>Consistent image style:</strong></p><p id="149ba153-4679-80da-a3b4-cdbb142ab538" class="">Ensure you don&#x27;t mix styles within your dataset; for example, a dataset should not contain both animated cars and photo-realistic cars together..</p><div id="149ba153-4679-80f4-84fe-ddf0874ca9d0" class="column-list"><div id="149ba153-4679-81fa-a5db-f4fd5ff350e8" style="width:33.333333333333336%" class="column"><figure id="149ba153-4679-81a2-8639-c2e2462d3d5e" class="image"><a href="https://platform.bria.ai/assets/Consistent%20image%20style_-cef545b2.png"><img style="width:160px" src="https://platform.bria.ai/assets/Consistent%20image%20style_-cef545b2.png"/></a></figure></div><div id="149ba153-4679-8172-9306-c8e724768450" style="width:33.333333333333336%" class="column"><figure id="149ba153-4679-810e-baeb-f5db484b8908" class="image"><a href="https://platform.bria.ai/assets/Consistent%20image%20style_2-fd7a1239.png"><img style="width:160px" src="https://platform.bria.ai/assets/Consistent%20image%20style_2-fd7a1239.png"/></a></figure></div><div id="149ba153-4679-813d-805e-eb32e4ac4797" style="width:33.33333333333333%" class="column"><figure id="149ba153-4679-8186-811f-fa8b4627c783" class="image"><a href="https://platform.bria.ai/assets/Consistent%20image%20style_3-a41423bd.png"><img style="width:160px" src="https://platform.bria.ai/assets/Consistent%20image%20style_3-a41423bd.png"/></a></figure></div></div><hr id="149ba153-4679-803e-9acb-ff295884c395"/><p id="149ba153-4679-8010-aa6d-c085e2f13e87" class=""><strong>Group of subjects:</strong></p><p id="149ba153-4679-8019-a3c2-c2b1eaae0575" class="">If your goal is to generate images featuring your subject in a group, it is advisable to include multiple examples of such groupings in the dataset.</p><div id="149ba153-4679-8098-a774-f84a3efd0903" class="column-list"><div id="149ba153-4679-818d-9d21-c5c0242eb5cc" style="width:33.333333333333336%" class="column"><figure id="149ba153-4679-819f-b03f-c84fce221e2b" class="image"><a href="https://platform.bria.ai/assets/Group%20Of%20subjects-8033aca4.png"><img style="width:160px" src="https://platform.bria.ai/assets/Group%20Of%20subjects-8033aca4.png"/></a></figure><p id="149ba153-4679-8070-adb7-cdd6cbf2ccfe" class="">
</p></div><div id="149ba153-4679-813c-9547-c863500a1c07" style="width:33.333333333333336%" class="column"><figure id="149ba153-4679-81b3-b77b-cf5eb6328663" class="image"><a href="https://platform.bria.ai/assets/Group%20Of%20subjects2-53e50c35.png"><img style="width:160px" src="https://platform.bria.ai/assets/Group%20Of%20subjects2-53e50c35.png"/></a></figure></div><div id="149ba153-4679-8194-a4c9-f4e55bbb66da" style="width:33.33333333333333%" class="column"><figure id="149ba153-4679-8192-b115-d22329ffc52c" class="image"><a href="https://platform.bria.ai/assets/Group%20Of%20subjects3-b1657952.png"><img style="width:160px" src="https://platform.bria.ai/assets/Group%20Of%20subjects3-b1657952.png"/></a></figure></div></div><p id="149ba153-4679-805e-b768-c76cce4719d6" class="">
</p><h3 id="149ba153-4679-8096-9ec3-cd37027f0d2c" class="">Icons</h3><p id="149ba153-4679-80bd-82a6-c61f709222a7" class="">When training a model for a specific icon style, it is crucial to provide images that contain the right information to guide the model. Users should upload 20-50 images, and the dataset should consist of a clear icons’ style within a specific domain.</p><p id="149ba153-4679-8033-a6e4-e54bc654b4eb" class="">The images in your dataset should consider multiple types of icons sharing the same style.</p><p id="149ba153-4679-8078-9445-d7434906fe88" class="">
</p><p id="149ba153-4679-8018-84ac-e32b04533b84" class=""><strong>Examples of common use cases:</strong></p><p id="149ba153-4679-805e-9b37-fea58f3c800e" class="">
</p><p id="149ba153-4679-80aa-9f57-d11afbed2357" class=""><strong>Share the same style:</strong></p><div id="149ba153-4679-8089-8363-c604d8c24c73" class="column-list"><div id="149ba153-4679-80ef-bb91-d359b40b9043" style="width:53.125%" class="column"><p id="149ba153-4679-8064-89c6-eee35a5fef5e" class="">Datasets can include a wide range of variations as long as they share the same icons style.</p></div><div id="149ba153-4679-80e7-8538-c11d4cf3d680" style="width:15.624999999999996%" class="column"><figure id="149ba153-4679-81b6-b970-cfb7bf6e8d8f" class="image"><a href="https://platform.bria.ai/assets/Icons%20Share%20the%20same%20style_1-032bd2c7.png"><img style="width:205.32669067382812px" src="https://platform.bria.ai/assets/Icons%20Share%20the%20same%20style_1-032bd2c7.png"/></a></figure></div><div id="149ba153-4679-80c0-9658-fb03e4fe802f" style="width:15.625%" class="column"><figure id="149ba153-4679-8166-8408-e5bd118da43e" class="image"><a href="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%203.png"><img style="width:205.31959533691406px" src="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%203.png"/></a></figure></div><div id="149ba153-4679-8092-8b2c-c9c04d8f5bff" style="width:15.624999999999996%" class="column"><figure id="149ba153-4679-8113-9848-c83279828237" class="image"><a href="https://platform.bria.ai/assets/Icons%20Share%20the%20same%20style_2-a8cb6543.png"><img style="width:205.32669067382812px" src="https://platform.bria.ai/assets/Icons%20Share%20the%20same%20style_2-a8cb6543.png"/></a></figure></div></div><figure id="149ba153-4679-80d5-90c8-d21c2eb5d8a1" class="image">
</figure><hr id="149ba153-4679-808b-b8ad-c7a51791229c"/><p id="149ba153-4679-8082-b66e-d511c2ae8256" class="">
</p><p id="149ba153-4679-8038-8a78-f8c9d3f3efe2" class=""><strong>Define the style of the icons in details:</strong></p><div id="149ba153-4679-80ed-a82c-f3c95ef8df7f" class="column-list"><div id="149ba153-4679-807a-9870-ccf4cff0e58a" style="width:53.125%" class="column"><p id="149ba153-4679-805a-be40-e720d12344d0" class="">Ensure the description of the icon’s style is as detailed as possible.For example: vector illustration , line art, very thick continuous outlines, minimalistic illustration, vector drawn strokes, continuous strokes</p></div><div id="149ba153-4679-8027-a471-fa22df5d08a4" style="width:15.625%" class="column"><figure id="149ba153-4679-819f-98a9-f668a482ea17" class="image"><a href="https://platform.bria.ai/assets/Define%20the%20style%20of%20the%20icons%20in%20details-58dcef9a.png"><img style="width:205.32669067382812px" src="https://platform.bria.ai/assets/Define%20the%20style%20of%20the%20icons%20in%20details-58dcef9a.png"/></a></figure><p id="149ba153-4679-803e-8bac-c09e88edbdb5" class="">
</p></div><div id="149ba153-4679-8090-9d2e-e6e7b59a3b36" style="width:15.624999999999995%" class="column"><figure id="149ba153-4679-8165-a0da-e1a2a5770039" class="image"><a href="https://platform.bria.ai/assets/Define%20the%20style%20of%20the%20icons%20in%20details4-5fcd011b.png"><img style="width:205.32669067382812px" src="https://platform.bria.ai/assets/Define%20the%20style%20of%20the%20icons%20in%20details4-5fcd011b.png"/></a></figure></div><div id="149ba153-4679-80c9-8cb8-c1225dd474e9" style="width:15.625000000000004%" class="column"><figure id="149ba153-4679-81e0-8dc3-e896d4d77fbf" class="image"><a href="https://platform.bria.ai/assets/Define%20the%20style%20of%20the%20icons%20in%20details3-1f2a5bc2.png"><img style="width:205.32669067382812px" src="https://platform.bria.ai/assets/Define%20the%20style%20of%20the%20icons%20in%20details3-1f2a5bc2.png"/></a></figure></div></div><hr id="149ba153-4679-809d-9a66-f14f1d92a8fa"/><p id="149ba153-4679-80d0-9269-e8a0178d6970" class="">
</p><p id="149ba153-4679-8076-b970-c0c561e75f39" class=""><strong>For SVG images, use simple 2D images for training:</strong></p><div id="149ba153-4679-8035-8bf0-df8d675feded" class="column-list"><div id="149ba153-4679-80a1-a255-cfdabcf1fe65" style="width:53.125%" class="column"><p id="149ba153-4679-8083-a81a-cb00ad54b1e1" class="">To create high-quality images in SVG format, use simple 2D images in your dataset. Images should not include many details, shading, or complex styling.</p></div><div id="149ba153-4679-80ac-b76d-e6c3d6133af4" style="width:15.625%" class="column"><figure id="149ba153-4679-816b-a26a-c26db2e3b11f" class="image"><a href="https://platform.bria.ai/assets/For%20SVG%20images_%20use%20simple%202D%20images%20for%20training-a7a99486.png"><img style="width:205.32669067382812px" src="https://platform.bria.ai/assets/For%20SVG%20images_%20use%20simple%202D%20images%20for%20training-a7a99486.png"/></a></figure><p id="149ba153-4679-803d-b89b-f52808dd543a" class="">
</p></div><div id="149ba153-4679-80ee-995c-e2940db8d14a" style="width:15.625%" class="column"><figure id="149ba153-4679-8177-9dc6-d858e6a87a81" class="image"><a href="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%204.png"><img style="width:205.31959533691406px" src="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%204.png"/></a></figure></div><div id="149ba153-4679-8090-beab-e75220d742db" style="width:15.625%" class="column"><figure id="149ba153-4679-818d-abd4-ecd9f9da071b" class="image"><a href="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%205.png"><img style="width:205.31959533691406px" src="%5BBria-LoRa-FineTune%5D%206c6ceb0ec7a040e4b270a0ecb60585f0/image%205.png"/></a></figure></div></div><figure id="149ba153-4679-8007-9260-ed31688bfba2" class="image">
</figure><p id="8d7189d8-60e1-4105-84f3-6440f80acbd7" class="">
</p><h2 id="d7295af2-0fce-493f-8c0b-1e6271239248" class="">Captions / Prompts </h2><p id="3a38850f-51a5-46c9-80b0-0b6c108dfdb7" class="">WIP</p><p id="78fc3213-f449-4294-866a-07e37a656e3d" class="">
</p><h2 id="2313cc32-1a8b-4087-b2d3-db00048d0a22" class="">Compute</h2><p id="38d0bb7e-7484-4460-a2d4-dce103222a2d" class="">We run on Nvidia A10 GPU:</p><ul id="58a34fa4-d225-4089-8c90-681de2da4f1c" class="bulleted-list"><li style="list-style-type:disc">On AWS - <code>g5.xlarge</code> / <code>g5.12xlarge</code></li></ul><p id="e7e278d6-2196-4058-993a-4d0eee780804" class="">
</p><hr id="7bf2cb6d-0751-4bd3-a215-fd56676eb1d4"/><p id="153f6676-0e13-425d-a85f-66f31ab92e62" class="">
</p><p id="934a5f03-5959-4596-a305-ed1c1109eace" class="">For any additional questions please contact <code>[email protected]</code> </p><p id="2283fb02-4e72-489f-9751-ec8f249f9ae2" class="">
</p></div></article><span class="sans" style="font-size:14px;padding-top:2em"></span></body></html>