mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-02-27 02:03:56 +00:00
revision_ini
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user