Skip to content

Commit

Permalink
ip-adapter add set_scale
Browse files Browse the repository at this point in the history
  • Loading branch information
deltheil committed Oct 2, 2023
1 parent 7f7e129 commit c484d3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/refiners/foundationals/latent_diffusion/image_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ def eject(self) -> None:
adapter.eject()
super().eject()

def set_scale(self, scale: float) -> None:
for cross_attn in self.sub_adapters:
cross_attn.scale = scale

# These should be concatenated to the CLIP text embedding before setting the UNet context
def compute_clip_image_embedding(self, image_prompt: Tensor) -> Tensor:
image_encoder = self.clip_image_encoder if not self.fine_grained else self.grid_image_encoder
Expand Down

0 comments on commit c484d3b

Please sign in to comment.