Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ def set_accelerate_default_config():
|
|
13 |
except subprocess.CalledProcessError as e:
|
14 |
print(f"An error occurred: {e}")
|
15 |
|
16 |
-
def train_dreambooth_lora_sdxl(instance_data_dir,
|
17 |
|
18 |
script_filename = "train_dreambooth_lora_sdxl.py" # Assuming it's in the same folder
|
19 |
|
@@ -24,7 +24,7 @@ def train_dreambooth_lora_sdxl(instance_data_dir, lora-trained-xl-folder, instan
|
|
24 |
"--pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0",
|
25 |
"--pretrained_vae_model_name_or_path=madebyollin/sdxl-vae-fp16-fix",
|
26 |
f"--instance_data_dir={instance_data_dir}",
|
27 |
-
f"--output_dir={
|
28 |
"--mixed_precision=fp16",
|
29 |
f"--instance_prompt={instance_prompt}",
|
30 |
"--resolution=1024",
|
@@ -81,7 +81,7 @@ def main(dataset_id,
|
|
81 |
gr.Info("Training begins ...")
|
82 |
|
83 |
instance_data_dir = repo_parts[-1]
|
84 |
-
train_dreambooth_lora_sdxl(instance_data_dir,
|
85 |
|
86 |
return f"Done, your trained model has been stored in your models library: your_user_name/{lora-trained-xl-folder}"
|
87 |
|
@@ -100,8 +100,8 @@ with gr.Blocks() as demo:
|
|
100 |
fn = main,
|
101 |
inputs = [
|
102 |
dataset_id,
|
103 |
-
instance_prompt,
|
104 |
model_output_folder,
|
|
|
105 |
max_train_steps,
|
106 |
checkpoint_steps
|
107 |
],
|
|
|
13 |
except subprocess.CalledProcessError as e:
|
14 |
print(f"An error occurred: {e}")
|
15 |
|
16 |
+
def train_dreambooth_lora_sdxl(instance_data_dir, lora_trained_xl_folder, instance_prompt, max_train_steps, checkpoint_steps):
|
17 |
|
18 |
script_filename = "train_dreambooth_lora_sdxl.py" # Assuming it's in the same folder
|
19 |
|
|
|
24 |
"--pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0",
|
25 |
"--pretrained_vae_model_name_or_path=madebyollin/sdxl-vae-fp16-fix",
|
26 |
f"--instance_data_dir={instance_data_dir}",
|
27 |
+
f"--output_dir={lora_trained_xl_folder}",
|
28 |
"--mixed_precision=fp16",
|
29 |
f"--instance_prompt={instance_prompt}",
|
30 |
"--resolution=1024",
|
|
|
81 |
gr.Info("Training begins ...")
|
82 |
|
83 |
instance_data_dir = repo_parts[-1]
|
84 |
+
train_dreambooth_lora_sdxl(instance_data_dir, lora_trained_xl_folder, instance_prompt, max_train_steps, checkpoint_steps)
|
85 |
|
86 |
return f"Done, your trained model has been stored in your models library: your_user_name/{lora-trained-xl-folder}"
|
87 |
|
|
|
100 |
fn = main,
|
101 |
inputs = [
|
102 |
dataset_id,
|
|
|
103 |
model_output_folder,
|
104 |
+
instance_prompt,
|
105 |
max_train_steps,
|
106 |
checkpoint_steps
|
107 |
],
|