Skip to content

Commit

Permalink
CTU: Use the Compel-provided embeds for prompting
Browse files Browse the repository at this point in the history
Signed-off-by: bghira <[email protected]>
  • Loading branch information
bghira committed May 14, 2023
1 parent 8a88db0 commit 8c5ae60
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions discord_tron_client/classes/image_manipulation/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,17 @@ def _controlnet_pipeline(self, image: Image, user_config: dict, pipe, generator)
image = self._resize_for_condition_image(
input_image=image, resolution=1024
)
prompt = user_config["tile_positive"]
negative_prompt = user_config["tile_negative"]
prompt_embed, negative_embed = self.prompt_manager.process_long_prompt(
positive_prompt=prompt, negative_prompt=negative_prompt
)

new_image = pipe(
prompt=user_config["tile_positive"],
negative_prompt=user_config["tile_negative"],
# prompt=prompt,
# negative_prompt=negative_prompt,
prompt_embeds=prompt_embed,
negative_prompt_embeds=negative_embed,
image=image,
controlnet_conditioning_image=image,
width=image.size[0],
Expand All @@ -392,6 +400,10 @@ def _controlnet_pipeline(self, image: Image, user_config: dict, pipe, generator)
return new_image

def _controlnet_all_images(self, preprocessed_images: list, user_config: dict, generator):
if int(user_config['strength']) == 0:
# Zero strength = Zero CTU.
return preprocessed_images

idx = 0
controlnet_pipe = self.pipeline_manager.get_controlnet_pipe()
for image in preprocessed_images:
Expand Down

0 comments on commit 8c5ae60

Please sign in to comment.