mirror of https://github.com/InstantID/InstantID
parent
98332df4c1
commit
e36ca465ec
|
|
@ -421,6 +421,7 @@ class IPAttnProcessor2_0(torch.nn.Module):
|
|||
if len(region_control.prompt_image_conditioning) == 1:
|
||||
region_mask = region_control.prompt_image_conditioning[0].get('region_mask', None)
|
||||
if region_mask is not None:
|
||||
query = query.reshape([-1, query.shape[-2], query.shape[-1]])
|
||||
h, w = region_mask.shape[:2]
|
||||
ratio = (h * w / query.shape[1]) ** 0.5
|
||||
mask = F.interpolate(region_mask[None, None], scale_factor=1/ratio, mode='nearest').reshape([1, -1, 1])
|
||||
|
|
|
|||
Loading…
Reference in New Issue