mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-01-26 16:39:47 +00:00
Added Differential Guidance training target
This commit is contained in:
@@ -545,7 +545,10 @@ class TrainConfig:
|
||||
self.unconditional_prompt: str = kwargs.get('unconditional_prompt', '')
|
||||
if isinstance(self.guidance_loss_target, tuple):
|
||||
self.guidance_loss_target = list(self.guidance_loss_target)
|
||||
|
||||
|
||||
self.do_differential_guidance = kwargs.get('do_differential_guidance', False)
|
||||
self.differential_guidance_scale = kwargs.get('differential_guidance_scale', 3.0)
|
||||
|
||||
# for multi stage models, how often to switch the boundary
|
||||
self.switch_boundary_every: int = kwargs.get('switch_boundary_every', 1)
|
||||
|
||||
|
||||
@@ -2907,7 +2907,7 @@ class StableDiffusion:
|
||||
try:
|
||||
te_has_grad = encoder.text_model.final_layer_norm.weight.requires_grad
|
||||
except:
|
||||
te_has_grad = encoder.encoder.block[0].layer[0].SelfAttention.q.weight.requires_grad
|
||||
te_has_grad = False
|
||||
self.device_state['text_encoder'].append({
|
||||
'training': encoder.training,
|
||||
'device': encoder.device,
|
||||
|
||||
Reference in New Issue
Block a user