revision_ini

This commit is contained in:
lllyasviel
2024-01-30 10:32:54 -08:00
parent e3dcb2c5a3
commit f20f6d9cc6
6 changed files with 166 additions and 46 deletions

View File

@@ -76,6 +76,9 @@ def forge_sample(self, denoiser_params, cond_scale, cond_composition):
for h in cond + uncond:
h['control'] = control
for modifier in model_options.get('conditioning_modifiers', []):
model, x, timestep, uncond, cond, cond_scale, model_options, seed = modifier(model, x, timestep, uncond, cond, cond_scale, model_options, seed)
denoised = sampling_function(model, x, timestep, uncond, cond, cond_scale, model_options, seed)
return denoised

View File

@@ -33,3 +33,13 @@ class UnetPatcher(ModelPatcher):
results.append(pointer)
pointer = pointer.previous_controlnet
return results
def add_conditioning_modifier(self, modifier, ensure_uniqueness=False):
if 'conditioning_modifiers' not in self.model_options:
self.model_options['conditioning_modifiers'] = []
if ensure_uniqueness and modifier in self.model_options['conditioning_modifiers']:
return
self.model_options['conditioning_modifiers'].append(modifier)
return