Spaces:
Running
on
Zero
Running
on
Zero
Update ip_adapter/ip_adapter.py
Browse files- ip_adapter/ip_adapter.py +11 -1
ip_adapter/ip_adapter.py
CHANGED
@@ -116,7 +116,16 @@ class IPAdapter:
|
|
116 |
for attn_processor in self.pipe.unet.attn_processors.values():
|
117 |
if isinstance(attn_processor, IPAttnProcessor):
|
118 |
attn_processor.scale = scale
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
def generate(
|
121 |
self,
|
122 |
pil_image,
|
@@ -129,6 +138,7 @@ class IPAdapter:
|
|
129 |
num_inference_steps=30,
|
130 |
**kwargs,
|
131 |
):
|
|
|
132 |
self.set_scale(scale)
|
133 |
|
134 |
if isinstance(pil_image, List):
|
|
|
116 |
for attn_processor in self.pipe.unet.attn_processors.values():
|
117 |
if isinstance(attn_processor, IPAttnProcessor):
|
118 |
attn_processor.scale = scale
|
119 |
+
|
120 |
+
def get_scale(self):
|
121 |
+
for attn_processor in self.pipe.unet.attn_processors.values():
|
122 |
+
if isinstance(attn_processor, IPAttnProcessor):
|
123 |
+
print('IP attn_scale:')
|
124 |
+
print(attn_processor.scale)
|
125 |
+
if isinstance(attn_processor):
|
126 |
+
print('UNET attn_scale:')
|
127 |
+
print(attn_processor.scale)
|
128 |
+
|
129 |
def generate(
|
130 |
self,
|
131 |
pil_image,
|
|
|
138 |
num_inference_steps=30,
|
139 |
**kwargs,
|
140 |
):
|
141 |
+
self.get_scale()
|
142 |
self.set_scale(scale)
|
143 |
|
144 |
if isinstance(pil_image, List):
|