Skip to content

Commit

Permalink
Compel: allow disabling via config flag, and add to example config
Browse files Browse the repository at this point in the history
Signed-off-by: bghira <[email protected]>
  • Loading branch information
bghira committed Jul 8, 2023
1 parent 640f78c commit 6e7d339
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions discord_tron_client/classes/app_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,6 @@ def is_bark_enabled(self):

def bark_subsystem_type(self):
return self.config.get("bark_subsystem", "torch")

def enable_compel(self):
return self.config.get("use_compel_prompt_weighting", True)
2 changes: 1 addition & 1 deletion discord_tron_client/classes/image_manipulation/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def _generate_image_with_pipe(

prompt_embed = None
negative_embed = None
if not promptless_variation and self.prompt_manager.should_enable(pipe):
if not promptless_variation and self.prompt_manager.should_enable(pipe) and self.config.enable_compel():
prompt_embed, negative_embed = self.prompt_manager.process_long_prompt(
positive_prompt=prompt, negative_prompt=negative_prompt
)
Expand Down
1 change: 1 addition & 0 deletions discord_tron_client/config/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"friendly_name": "system name",
"master_api_key": "",
"model_path": "/home/user/.cache/huggingface/hub",
"use_compel_prompt_weighting": true,
"target_partition": "/dev/sda3",
"llama_model_path": "/archive/models/LLaMA",
"websocket_hub": {
Expand Down

0 comments on commit 6e7d339

Please sign in to comment.