Skip to main content

No project description provided

Project description

🪄SCEPTER

📖 Table of Contents

📝 Introduction

SCEPTER is an open-source code repository dedicated to generative training, fine-tuning, and inference, encompassing a suite of downstream tasks such as image generation, transfer, editing. It integrates popular community-driven implementations as well as proprietary methods by Tongyi Lab of Alibaba Group, offering a comprehensive toolkit for researchers and practitioners in the field of AIGC. This versatile library is designed to facilitate innovation and accelerate development in the rapidly evolving domain of generative models.

Main Feature:

  • Training:
    • distribute: DDP / FSDP / FairScale
  • Inference
    • text-to-image generation
    • controllable image synthesis (TODO)
  • Deploy-Gradio (TODO)
    • fine-tuning
    • inference

Currently supported approches (and counting):

  1. SD Series: Stable Diffusion v1.5 / Stable Diffusion v2.1 / Stable Diffusion XL
  2. SCEdit: SCEdit: Efficient and Controllable Image Diffusion Generation via Skip Connection Editing Arxiv link Page link
  3. Res-Tuning(TODO): Res-Tuning: A Flexible and Efficient Tuning Paradigm via Unbinding Tuner from Backbone Arxiv link Page link

🎉 News

  • [2023.12]: We propose SCEdit, an efficient and controllable generation framework.
  • [2023.12]: We release 🪄SCEPTER library.

🛠️ Installation

  • Create new environment
conda env create -f environment.yaml
conda activate scepter
  • Install SCEPTER by the pip command:
pip install -e .

🚀 Getting Started

Dataset

Text-to-Image generation

We use a custom-stylized dataset, which included classes 3D, anime, flat illustration, oil painting, sketch, and watercolor, each with 30 image-text pairs.

# pip install modelscope
from modelscope.msdatasets import MsDataset
ms_train_dataset = MsDataset.load('style_custom_dataset', namespace='damo', subset_name='3D', split='train_short')
print(next(iter(ms_train_dataset)))

Training

Text-to-Image generation

  • SCEdit
# SD v1.5
python scepter/tools/run_train.py --cfg scepter/methods/SCEdit/t2i_sd15_512_sce.yaml 
# SD v2.1
python scepter/tools/run_train.py --cfg scepter/methods/SCEdit/t2i_sd21_768_sce.yaml
# SD XL
python scepter/tools/run_train.py --cfg scepter/methods/SCEdit/t2i_sdxl_1024_sce.yaml
  • Existing strategies
# fully-tuning on SD v1.5
python scepter/tools/run_train.py --cfg scepter/methods/examples/generation/stable_diffusion_1.5_512.yaml
# lora-tuning on SD v2.1
python scepter/tools/run_train.py --cfg scepter/methods/examples/generation/stable_diffusion_2.1_768_lora.yaml 

Controllable Image Synthesis

TODO

Inference

# generation on SD v1.5
python scepter/tools/run_inference.py --cfg scepter/methods/examples/generation/stable_diffusion_1.5_512.yaml --prompt 'a cute dog' --save_folder 'inference'
# generation on SD v2.1
python scepter/tools/run_inference.py --cfg scepter/methods/examples/generation/stable_diffusion_2.1_768.yaml --prompt 'a cute dog' --save_folder 'inference'
# generation on SD XL
python scepter/tools/run_inference.py --cfg scepter/methods/examples/generation/stable_diffusion_xl_1024.yaml --prompt 'a cute dog' --save_folder 'inference'

🔍 Learn More

License

This project is licensed under the Apache License (Version 2.0).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

scepter-0.0.1-py3-none-any.whl (263.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page