Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Stable Diffusion Model Options with ModSpec #2977

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bsu3338
Copy link
Contributor

@bsu3338 bsu3338 commented Jun 6, 2024

Summary

I wanted to be able to set custom parameters for Stable Diffusion to use SDXL Turbo to generate images.

https://stable-diffusion-art.com/sdxl-turbo/

This change allows LibreChat admins to setup a profile that can be used with various model specs.

image

Change Type

Please delete any irrelevant options.

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Translation update

Testing

Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.

librechat.yaml

modelSpecs:
  enforce: true
  prioritize: true
  list:
    - name: "general_ai_assistant_01"
      default: true
      label: "AI Assistant"
      description: "General Use AI Assistant"
      preset:
        modelLabel: "Llama3"
        endpoint: "CampusAI"
        greeting: "Hello! How can I assist you today?"
        promptPrefix: "Provide assistance with "
        model: "llama3"
        temperature: 0.5

    - name: "sd_assistant_01"
      default: false
      label: "SD Assistant Turbo"
      description: "Generate image with Stable Diffusion turbo model"
      preset:
        modelLabel: "GPT-3.5-Turbo"
        endpoint: "gptPlugins"
        greeting: "What image would you like to create?"
        promptPrefix: "Create an image of a  "
        model: "gpt-3.5-turbo"
        temperature: 0.5
        tools: [stable-diffusion]
        agentOptions:
          model: "gpt-3.5-turbo"

    - name: "sd_assistant_02"
      default: false
      label: "SD Assistant SDXL"
      description: "Generate image with Stable Diffusion XL model"
      preset:
        modelLabel: "GPT-3.5-Turbo"
        endpoint: "gptPlugins"
        greeting: "What image would you like to create?"
        promptPrefix: "Create an image of a  "
        model: "gpt-3.5-turbo"
        temperature: 0.5
        tools: [stable-diffusion]
        agentOptions:
          model: "gpt-3.5-turbo"

tools:
  stableDiffusion:
    - name: "SDXL Turbo"
      webUI: "http://10.12.0.20:7860"
      specs: ["sd_assistant_01"]
      parameters:
        sd_model_name: "sd_xl_turbo_1.0_fp16"
        negative_prompt: ""
        sampler_name: "Euler a"
        cfg_scale: 1
        steps: 1
        width: 512
        height: 512
    - name: "SDXL"
      webUI: "http://10.12.0.20:7860"
      specs: ["sd_assistant_02"]
      parameters:
        sd_model_name: "sd_xl_refiner_1.0"
        sampler_name: "Euler a"
        cfg_scale: 7
        steps: 20
        width: 512
        height: 512

Test Configuration:

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.
  • New documents have been locally validated with mkdocs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant