mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-29 10:41:25 +00:00
Update forge_reference.py
This commit is contained in:
@@ -83,6 +83,8 @@ class PreprocessorReference(Preprocessor):
|
|||||||
if not (sigma_min <= sigma <= sigma_max):
|
if not (sigma_min <= sigma <= sigma_max):
|
||||||
return h
|
return h
|
||||||
|
|
||||||
|
C = int(h.shape[1])
|
||||||
|
|
||||||
if self.is_recording_style:
|
if self.is_recording_style:
|
||||||
self.recorded_h[location] = torch.std_mean(h, dim=(2, 3), keepdim=True, correction=0)
|
self.recorded_h[location] = torch.std_mean(h, dim=(2, 3), keepdim=True, correction=0)
|
||||||
return h
|
return h
|
||||||
@@ -121,6 +123,8 @@ class PreprocessorReference(Preprocessor):
|
|||||||
location = (transformer_options['block'][0], transformer_options['block'][1],
|
location = (transformer_options['block'][0], transformer_options['block'][1],
|
||||||
transformer_options['block_index'])
|
transformer_options['block_index'])
|
||||||
|
|
||||||
|
C = int(q.shape[2])
|
||||||
|
|
||||||
if self.is_recording_style:
|
if self.is_recording_style:
|
||||||
self.recorded_attn1[location] = (k, v)
|
self.recorded_attn1[location] = (k, v)
|
||||||
return sdp(q, k, v, transformer_options)
|
return sdp(q, k, v, transformer_options)
|
||||||
|
|||||||
Reference in New Issue
Block a user