Skip to main content

SwitchGen

A Linux-native AI image generator with a GTK4 interface. Uses ComfyUI as an embedded library for Stable Diffusion workflows.

Features

  • Text-to-image generation
  • Image-to-image transformation
  • Inpainting with mask support
  • Audio generation (Stable Audio)
  • 3D novel view synthesis (Zero123)
  • Built-in model downloader for HuggingFace models
  • Real-time generation progress
  • VRAM monitoring and cleanup

Installation

Arch Linux (AUR)

yay -S switchgen-git

Manual Installation

1. Clone with submodules

git clone --recursive https://github.com/Djwarf/switchgen.git
cd switchgen

If already cloned without submodules:

git submodule update --init --recursive

2. Install system dependencies

# Arch Linux
sudo pacman -S gtk4 libadwaita python-gobject python-pytorch python-torchvision

# Other distributions
# Install GTK4, libadwaita, PyGObject, and PyTorch with CUDA support

3. Install Python package

pip install -e .

Usage

Launch the application:

switchgen

Or run as a module:

python -m switchgen

First Run

  1. Click the download button in the header bar to open the model manager
  2. Download required models (checkpoints, VAE, CLIP, etc.)
  3. Select a workflow type and checkpoint
  4. Enter a prompt and click Generate

Project Structure

switchgen/
├── src/switchgen/
│   ├── core/
│   │   ├── comfy_init.py    # ComfyUI initialization
│   │   ├── config.py        # Path and app configuration
│   │   ├── downloader.py    # HuggingFace model downloader
│   │   ├── engine.py        # Generation engine
│   │   ├── models.py        # Model catalog
│   │   ├── queue.py         # Job queue system
│   │   └── workflows.py     # Workflow builders
│   │
│   ├── ui/
│   │   ├── main_window.py   # Main GTK4 window
│   │   ├── model_dialog.py  # Model download dialog
│   │   └── styles/          # CSS themes
│   │
│   └── resources/
│       └── fonts/           # Bundled fonts
│
├── vendor/
│   └── ComfyUI/             # Bundled ComfyUI engine (submodule)
│
├── models/                  # Downloaded models
├── custom_nodes/            # User custom nodes
├── output/                  # Generated images
└── temp/                    # Temporary files

Supported Workflows

Workflow Description Required Models
Text2Img Generate images from text prompts Checkpoint, VAE
Img2Img Transform existing images Checkpoint, VAE
Inpaint Edit specific regions with masks Checkpoint, VAE
Audio Generate audio from text Stable Audio checkpoint
3D Generate novel views of objects Zero123 checkpoint, CLIP ViT-L

Model Storage

Models are stored in the models/ directory:

models/
├── checkpoints/      # Main model files (.safetensors, .ckpt)
├── vae/              # VAE models
├── clip_vision/      # CLIP vision encoders
├── text_encoders/    # Text encoders (T5, etc.)
├── controlnet/       # ControlNet models
├── loras/            # LoRA adapters
└── upscale_models/   # Upscaling models

Requirements

  • Python 3.10 or later
  • GTK4 and libadwaita
  • PyTorch with CUDA support
  • NVIDIA GPU with 8GB+ VRAM recommended

Configuration

The application auto-detects paths. To override:

  • Set COMFYUI_PATH environment variable to use an external ComfyUI installation
  • Models are stored in ./models/ relative to the application root

Troubleshooting

Missing models error

Open the model download dialog and download the required models for your workflow.

VRAM out of memory

  • Close other GPU applications
  • Use smaller image dimensions
  • Try a different checkpoint (some use less VRAM)

Custom nodes not loading

Place custom node folders in the custom_nodes/ directory and restart the application.

License

MIT License. See LICENSE file for details.

Credits

  • ComfyUI by comfyanonymous
  • Stable Diffusion by Stability AI
  • GTK4 and libadwaita by GNOME

Metadata

Release files for switchgen 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for switchgen 0.1.1
File Size Uploaded Provenance
switchgen-0.1.1.tar.gz 6.9 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for switchgen 0.1.1
File Interpreter ABI Platform
switchgen-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.2 MB

Release files / switchgen-0.1.1.tar.gz

Download URL switchgen-0.1.1.tar.gz
Size 6.9 MB
Tags Source
SHA-256 checksum
How to use checksums
db60e2a4d1faee2ceea21008c2d528203d4b8f0e6324aedef3ffa5a9c7df3ca3
BLAKE2b-256 checksum
How to use checksums
255e175949876edad40b4f275f6bc5477f8e4d826838defeb847fb458b44e297
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / switchgen-0.1.1-py3-none-any.whl

Download URL switchgen-0.1.1-py3-none-any.whl
Size 391.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecbb4d82bc4351bdcdece7b75746336bae8a260a28770ca38f0ead05047ca51c
BLAKE2b-256 checksum
How to use checksums
c9bb114ebb2cfa3b30643863b3388b69d5c0285659be752ca7e822bc92a6828b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for switchgen 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page