ZeldaFan0225 / AI_Horde_Discord

A discord bot to interact with https://aihorde.net
GNU Affero General Public License v3.0
50 stars 14 forks source link

trim style/category prefixes, add support for lora weights and lora versions #53

Closed Efreak closed 6 months ago

Efreak commented 9 months ago

Add support for lora versions, lora weights, and clip skip; ignore style/category prefixes for copied commands

Detailed Description

  1. add support for clip_skip parameter and in styles
  2. add support for specific versions of loras by prefixing them with a "v". Ideally this would use a different parameter, but the number of parameters is running low (and there's other unimplemented features like controlnet that might eventually use them), and this is advanced usage. prefixes can be ignored by the user calling them if desired, but autocomplete was also modified to display the name of the lora just in case.
  3. Allow lora clip and model strengths to be set. Implemented for styles using the same schema as the API. implemented for the advanced generate command using the format id:modelweight:clipweight (see above explanation regarding why it's not split into parameters)
  4. Remove Style: and Category: from style names and trim spaces before processing

Why this is needed

  1. Clip Skip is wanted for some styles. Clip skip affects how stable diffusion processes the text input, and can sort of make prompts more generic in a way (less specific).
  2. civitai hosts multiple versions of loras, and horde now has support for these
  3. lora clip and model weights affect how strongly the Lora affects the resulting generation
  4. the style: and category: prefixes are incredibly annoying when copy/pasting commands. I have a habit of simply removing them as they're unnecessary, but I occasionally see them tripping other people up when they paste a command (once you copy/paste the command, discord loses the difference between the text you see and the internal value it has). Actually, filtering this out for model name would be nice as well, but isn't usually as much of an issue.

Overall, these changes are mostly intended to expand support for styles, but changes were made to the generate commands to support the same functions there as well.


I've tested everything I changed on my own instance of the bot, but I can't help feeling like there might be something I've missed, simply because I fixed so many mistakes I made while doing this.