Skip to content

Commit 9f85028

Browse files
committed
updates
1 parent 857b3a0 commit 9f85028

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/dreambooth/train_dreambooth_lora_lumina2.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def save_model_card(
8585
images=None,
8686
base_model: str = None,
8787
instance_prompt=None,
88+
system_prompt=None,
8889
validation_prompt=None,
8990
repo_folder=None,
9091
):
@@ -112,6 +113,8 @@ def save_model_card(
112113
113114
You should use `{instance_prompt}` to trigger the image generation.
114115
116+
The following `system_prompt` was also used used during training (ignore if `None`): {system_prompt}.
117+
115118
## Download model
116119
117120
[Download the *.safetensors LoRA]({repo_id}/tree/main) in the Files & versions tab.
@@ -1373,8 +1376,8 @@ def get_sigmas(timesteps, n_dim=4, dtype=torch.float32):
13731376
noisy_model_input = (1.0 - sigmas) * noise + sigmas * model_input
13741377

13751378
# Predict the noise residual
1376-
# reverse the timestep since Lumina uses t=0 as the noise and t=1 as the image
1377-
timesteps = 1 - timesteps / noise_scheduler.config.num_train_timesteps
1379+
# scale the timesteps (reversal not needed as we used a reverse lerp above already)
1380+
timesteps = timesteps / noise_scheduler.config.num_train_timesteps
13781381
model_pred = transformer(
13791382
hidden_states=noisy_model_input,
13801383
encoder_hidden_states=prompt_embeds,
@@ -1532,6 +1535,7 @@ def get_sigmas(timesteps, n_dim=4, dtype=torch.float32):
15321535
images=images,
15331536
base_model=args.pretrained_model_name_or_path,
15341537
instance_prompt=args.instance_prompt,
1538+
system_prompt=args.system_prompt,
15351539
validation_prompt=args.validation_prompt,
15361540
repo_folder=args.output_dir,
15371541
)

0 commit comments

Comments
 (0)