cloneofsimo
/
lora_pti
- Public
- 26 runs
Run cloneofsimo/lora_pti with an API
Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.
Input schema
The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.
Field | Type | Default value | Description |
---|---|---|---|
instance_data |
string
|
A ZIP file containing your training images (JPG, PNG, etc. size not restricted). These images contain your 'subject' that you want the trained model to embed in the output domain for later generating customized scenes beyond the training images. For best results, use images without noise or unrelated objects in the background.
|
|
class_data |
string
|
An optional ZIP file containing the training data of class images. This corresponds to `class_prompt` above, also with the purpose of keeping the model generalizable. By default, the pretrained stable-diffusion model will generate N images (determined by the `num_class_images` you set) based on the `class_prompt` provided. But to save time or to have your preferred specific set of `class_data`, you can also provide them in a ZIP file.
|
|
seed |
integer
|
1337
|
A seed for reproducible training
|
resolution |
integer
|
512
|
The resolution for input images. All the images in the train/validation dataset will be resized to this resolution.
|
train_text_encoder |
boolean
|
True
|
Whether to train the text encoder
|
train_batch_size |
integer
|
1
|
Batch size (per device) for the training dataloader.
|
gradient_accumulation_steps |
integer
|
4
|
Number of updates steps to accumulate before performing a backward/update pass.
|
gradient_checkpointing |
boolean
|
False
|
Whether or not to use gradient checkpointing to save memory at the expense of slower backward pass.
|
scale_lr |
boolean
|
True
|
Scale the learning rate by the number of GPUs, gradient accumulation steps, and batch size.
|
lr_scheduler |
string
(enum)
|
constant
Options: linear, cosine, cosine_with_restarts, polynomial, constant, constant_with_warmup |
The scheduler type to use
|
lr_warmup_steps |
integer
|
0
|
Number of steps for the warmup in the lr scheduler.
|
use_8bit_adam |
boolean
|
False
|
Whether or not to use 8-bit Adam from bitsandbytes.
|
clip_ti_decay |
boolean
|
True
|
Whether or not to clip the TI decay to be between 0 and 1.
|
color_jitter |
boolean
|
True
|
Whether or not to use color jitter.
|
continue_inversion |
boolean
|
False
|
Whether or not to continue an inversion.
|
continue_inversion_lr |
number
|
0.0001
|
The learning rate for continuing an inversion.
|
device |
string
|
cuda:0
|
The device to use. Can be 'cuda' or 'cpu'.
|
initializer_tokens |
string
|
The tokens to use for the initializer. If not provided, will randomly initialize from gaussian N(0,0.017^2)
|
|
learning_rate_text |
number
|
0.00001
|
The learning rate for the text encoder.
|
learning_rate_ti |
number
|
0.0005
|
The learning rate for the TI.
|
learning_rate_unet |
number
|
0.0001
|
The learning rate for the unet.
|
lora_rank |
integer
|
4
|
The rank for the LORA loss.
|
lr_scheduler_lora |
string
(enum)
|
constant
Options: linear, cosine, cosine_with_restarts, polynomial, constant, constant_with_warmup |
The scheduler type to use
|
lr_warmup_steps_lora |
integer
|
0
|
Number of steps for the warmup in the lr scheduler.
|
max_train_steps_ti |
integer
|
500
|
The maximum number of training steps for the TI.
|
max_train_steps_tuning |
integer
|
1000
|
The maximum number of training steps for the tuning.
|
perform_inversion |
boolean
|
True
|
Whether or not to perform an inversion.
|
placeholder_token_at_data |
string
|
Whether or not to use a placeholder token at the data.
|
|
placeholder_tokens |
string
|
<s1>|<s2>
|
The placeholder tokens to use for the initializer. If not provided, will use the first tokens of the data.
|
save_steps |
integer
|
100
|
The number of steps between saving checkpoints.
|
use_face_segmentation_condition |
boolean
|
True
|
Whether or not to use the face segmentation condition.
|
use_template |
string
|
object
|
The template to use for the inversion.
|
weight_decay_lora |
number
|
0.001
|
The weight decay for the LORA loss.
|
weight_decay_ti |
number
|
0
|
The weight decay for the TI.
|
{
"type": "object",
"title": "Input",
"required": [
"instance_data"
],
"properties": {
"seed": {
"type": "integer",
"title": "Seed",
"default": 1337,
"x-order": 2,
"description": "A seed for reproducible training"
},
"device": {
"type": "string",
"title": "Device",
"default": "cuda:0",
"x-order": 16,
"description": "The device to use. Can be 'cuda' or 'cpu'."
},
"scale_lr": {
"type": "boolean",
"title": "Scale Lr",
"default": true,
"x-order": 8,
"description": "Scale the learning rate by the number of GPUs, gradient accumulation steps, and batch size."
},
"lora_rank": {
"type": "integer",
"title": "Lora Rank",
"default": 4,
"x-order": 21,
"description": "The rank for the LORA loss."
},
"class_data": {
"type": "string",
"title": "Class Data",
"format": "uri",
"x-order": 1,
"description": "An optional ZIP file containing the training data of class images. This corresponds to `class_prompt` above, also with the purpose of keeping the model generalizable. By default, the pretrained stable-diffusion model will generate N images (determined by the `num_class_images` you set) based on the `class_prompt` provided. But to save time or to have your preferred specific set of `class_data`, you can also provide them in a ZIP file."
},
"resolution": {
"type": "integer",
"title": "Resolution",
"default": 512,
"x-order": 3,
"description": "The resolution for input images. All the images in the train/validation dataset will be resized to this resolution."
},
"save_steps": {
"type": "integer",
"title": "Save Steps",
"default": 100,
"x-order": 29,
"description": "The number of steps between saving checkpoints."
},
"color_jitter": {
"type": "boolean",
"title": "Color Jitter",
"default": true,
"x-order": 13,
"description": "Whether or not to use color jitter."
},
"lr_scheduler": {
"enum": [
"linear",
"cosine",
"cosine_with_restarts",
"polynomial",
"constant",
"constant_with_warmup"
],
"type": "string",
"title": "lr_scheduler",
"description": "The scheduler type to use",
"default": "constant",
"x-order": 9
},
"use_template": {
"type": "string",
"title": "Use Template",
"default": "object",
"x-order": 31,
"description": "The template to use for the inversion."
},
"clip_ti_decay": {
"type": "boolean",
"title": "Clip Ti Decay",
"default": true,
"x-order": 12,
"description": "Whether or not to clip the TI decay to be between 0 and 1."
},
"instance_data": {
"type": "string",
"title": "Instance Data",
"format": "uri",
"x-order": 0,
"description": "A ZIP file containing your training images (JPG, PNG, etc. size not restricted). These images contain your 'subject' that you want the trained model to embed in the output domain for later generating customized scenes beyond the training images. For best results, use images without noise or unrelated objects in the background."
},
"use_8bit_adam": {
"type": "boolean",
"title": "Use 8Bit Adam",
"default": false,
"x-order": 11,
"description": "Whether or not to use 8-bit Adam from bitsandbytes."
},
"lr_warmup_steps": {
"type": "integer",
"title": "Lr Warmup Steps",
"default": 0,
"x-order": 10,
"description": "Number of steps for the warmup in the lr scheduler."
},
"weight_decay_ti": {
"type": "number",
"title": "Weight Decay Ti",
"default": 0,
"x-order": 33,
"description": "The weight decay for the TI."
},
"learning_rate_ti": {
"type": "number",
"title": "Learning Rate Ti",
"default": 0.0005,
"x-order": 19,
"description": "The learning rate for the TI."
},
"train_batch_size": {
"type": "integer",
"title": "Train Batch Size",
"default": 1,
"x-order": 5,
"description": "Batch size (per device) for the training dataloader."
},
"lr_scheduler_lora": {
"enum": [
"linear",
"cosine",
"cosine_with_restarts",
"polynomial",
"constant",
"constant_with_warmup"
],
"type": "string",
"title": "lr_scheduler_lora",
"description": "The scheduler type to use",
"default": "constant",
"x-order": 22
},
"perform_inversion": {
"type": "boolean",
"title": "Perform Inversion",
"default": true,
"x-order": 26,
"description": "Whether or not to perform an inversion."
},
"weight_decay_lora": {
"type": "number",
"title": "Weight Decay Lora",
"default": 0.001,
"x-order": 32,
"description": "The weight decay for the LORA loss."
},
"continue_inversion": {
"type": "boolean",
"title": "Continue Inversion",
"default": false,
"x-order": 14,
"description": "Whether or not to continue an inversion."
},
"initializer_tokens": {
"type": "string",
"title": "Initializer Tokens",
"x-order": 17,
"description": "The tokens to use for the initializer. If not provided, will randomly initialize from gaussian N(0,0.017^2)"
},
"learning_rate_text": {
"type": "number",
"title": "Learning Rate Text",
"default": 1e-05,
"x-order": 18,
"description": "The learning rate for the text encoder."
},
"learning_rate_unet": {
"type": "number",
"title": "Learning Rate Unet",
"default": 0.0001,
"x-order": 20,
"description": "The learning rate for the unet."
},
"max_train_steps_ti": {
"type": "integer",
"title": "Max Train Steps Ti",
"default": 500,
"x-order": 24,
"description": "The maximum number of training steps for the TI."
},
"placeholder_tokens": {
"type": "string",
"title": "Placeholder Tokens",
"default": "<s1>|<s2>",
"x-order": 28,
"description": "The placeholder tokens to use for the initializer. If not provided, will use the first tokens of the data."
},
"train_text_encoder": {
"type": "boolean",
"title": "Train Text Encoder",
"default": true,
"x-order": 4,
"description": "Whether to train the text encoder"
},
"lr_warmup_steps_lora": {
"type": "integer",
"title": "Lr Warmup Steps Lora",
"default": 0,
"x-order": 23,
"description": "Number of steps for the warmup in the lr scheduler."
},
"continue_inversion_lr": {
"type": "number",
"title": "Continue Inversion Lr",
"default": 0.0001,
"x-order": 15,
"description": "The learning rate for continuing an inversion."
},
"gradient_checkpointing": {
"type": "boolean",
"title": "Gradient Checkpointing",
"default": false,
"x-order": 7,
"description": "Whether or not to use gradient checkpointing to save memory at the expense of slower backward pass."
},
"max_train_steps_tuning": {
"type": "integer",
"title": "Max Train Steps Tuning",
"default": 1000,
"x-order": 25,
"description": "The maximum number of training steps for the tuning."
},
"placeholder_token_at_data": {
"type": "string",
"title": "Placeholder Token At Data",
"x-order": 27,
"description": "Whether or not to use a placeholder token at the data."
},
"gradient_accumulation_steps": {
"type": "integer",
"title": "Gradient Accumulation Steps",
"default": 4,
"x-order": 6,
"description": "Number of updates steps to accumulate before performing a backward/update pass."
},
"use_face_segmentation_condition": {
"type": "boolean",
"title": "Use Face Segmentation Condition",
"default": true,
"x-order": 30,
"description": "Whether or not to use the face segmentation condition."
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
Schema
{
"type": "string",
"title": "Output",
"format": "uri"
}