-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from invoke-ai/ryan/sdxl-prep-rename-stuff
Prep for SDXL support: rename training modes
- Loading branch information
Showing
12 changed files
with
111 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import argparse | ||
from pathlib import Path | ||
|
||
import yaml | ||
|
||
from invoke_training.training.finetune_lora.finetune_lora_config import ( | ||
FinetuneLoRAConfig, | ||
) | ||
from invoke_training.training.finetune_lora.finetune_lora_sd import run_training | ||
|
||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Finetuning with LoRA for Stable Diffusion v1 and v2 base models.") | ||
parser.add_argument( | ||
"--cfg-file", | ||
type=Path, | ||
required=True, | ||
help="Path to the YAML training config file. See `FinetuneLoRAConfig` for the supported fields.", | ||
) | ||
return parser.parse_args() | ||
|
||
|
||
def main(): | ||
args = parse_args() | ||
|
||
# Load YAML config file. | ||
with open(args.cfg_file, "r") as f: | ||
cfg = yaml.safe_load(f) | ||
|
||
train_config = FinetuneLoRAConfig(**cfg) | ||
|
||
run_training(train_config) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import argparse | ||
from pathlib import Path | ||
|
||
import yaml | ||
|
||
from invoke_training.training.finetune_lora.finetune_lora_config import ( | ||
FinetuneLoRAConfig, | ||
) | ||
from invoke_training.training.finetune_lora.finetune_lora_sdxl import run_training | ||
|
||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Finetuning with LoRA for Stable Diffusion XL models.") | ||
parser.add_argument( | ||
"--cfg-file", | ||
type=Path, | ||
required=True, | ||
help="Path to the YAML training config file. See `FinetuneLoRAConfig` for the supported fields.", | ||
) | ||
return parser.parse_args() | ||
|
||
|
||
def main(): | ||
args = parse_args() | ||
|
||
# Load YAML config file. | ||
with open(args.cfg_file, "r") as f: | ||
cfg = yaml.safe_load(f) | ||
|
||
train_config = FinetuneLoRAConfig(**cfg) | ||
|
||
run_training(train_config) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/invoke_training/training/finetune_lora/finetune_lora_sdxl.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from invoke_training.training.finetune_lora.finetune_lora_config import ( | ||
FinetuneLoRAConfig, | ||
) | ||
|
||
|
||
def run_training(config: FinetuneLoRAConfig): | ||
raise NotImplementedError("finetune_lora_sdxl is not implemented.") |
2 changes: 1 addition & 1 deletion
2
src/invoke_training/training/shared/datasets/image_caption_dataloader.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters