Skip to content

cgtuebingen/CharGen

Repository files navigation

Char-Gen: Fast and Fluent Character Modification

Char-gen example

Char-Gen is a fast image-to-image generation tool based on StreamDiffusions Image-to-Image Demo, using interactive LoRA sliders based on Concept Sliders. It allows users to upload an image, control generative LoRAs through sliders, and export stylized outputs.


Features

  • Fast image-to-image streaming using StreamDiffusion
  • Upload your own input image
  • Adjustable LoRA weights via sliders
  • Export enhanced output images
  • Compatible with custom-trained Concept Sliders

Installation

Requirements:

  • Node.js 18+
  • Python 3.10
# Build frontend
cd frontend
npm install
npm run build
cd ..

# Install dependencies
pip install -r requirements.txt

Usage

Start the app:

python main.py

Then open your browser to:
http://0.0.0.0:7860
(If this doesn’t load, try http://localhost:7860)

You’ll see this base screen:
Base Screen

  1. Upload an image
  2. Click Start
  3. Adjust LoRA sliders live
  4. Click Export to save the final image

LoRA Configuration

LoRAs are configured in lora_config.py. To add new LoRAs, add their path and default weight to the loras dictionary:

loras = {
    "./example-path/big-ears.pt": 0,
    "./example-path/cat-eyes.pt": 0.3,
}

Training Custom LoRAs

To create new slider-compatible LoRAs, use Concept Sliders. You can train from:

  • Image sliders
  • Text sliders

Exporting Results

Clicking the Export button will:

  • Re-run the image through a "Quality" LoRA using SD
  • Save it to the ./images folder

Export

If a name is entered, the image will be saved as:

./images/{your-name}.jpg

Otherwise, a timestamped filename will be used:

./images/export-<timestamp>.jpg

Notes

  • This provided Version uses StableDiffusion 1.4
  • When Training sliders, the same SD version as the base_model in the img2img.py needs to be used.

About

Char-Gen: Fluent character modification in real time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published