Created a v2 trainer and moved all the training logic to single torch model so it can can be run in parallel

This commit is contained in:
Jaret Burkett
2024-08-29 12:34:18 -06:00
parent 60232def91
commit a48c9aba8d
3 changed files with 1674 additions and 1 deletions

View File

@@ -19,6 +19,23 @@ class SDTrainerExtension(Extension):
return SDTrainer
# This is for generic training (LoRA, Dreambooth, FineTuning)
class MultiGPUSDTrainerExtension(Extension):
# uid must be unique, it is how the extension is identified
uid = "trainer_v2"
# name is the name of the extension for printing
name = "Trainer V2"
# This is where your process class is loaded
# keep your imports in here so they don't slow down the rest of the program
@classmethod
def get_process(cls):
# import your process class here so it is only loaded when needed and return it
from .TrainerV2 import TrainerV2
return TrainerV2
# for backwards compatability
class TextualInversionTrainer(SDTrainerExtension):
uid = "textual_inversion_trainer"
@@ -26,5 +43,5 @@ class TextualInversionTrainer(SDTrainerExtension):
AI_TOOLKIT_EXTENSIONS = [
# you can put a list of extensions here
SDTrainerExtension, TextualInversionTrainer
SDTrainerExtension, TextualInversionTrainer, MultiGPUSDTrainerExtension
]