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):
- SD Series: Stable Diffusion v1.5 / Stable Diffusion v2.1 / Stable Diffusion XL
- SCEdit: SCEdit: Efficient and Controllable Image Diffusion Generation via Skip Connection Editing
- Res-Tuning(TODO): Res-Tuning: A Flexible and Efficient Tuning Paradigm via Unbinding Tuner from Backbone
🎉 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
-
ModelScope Library is the model library of ModelScope project, which contains a large number of popular models.
-
Alibaba TongYi Vision Intelligence Lab
Discover more about open-source projects on image generation, video generation, and editing tasks.
License
This project is licensed under the Apache License (Version 2.0).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.