O repositório MMagic (Multimodal Advanced, Generative, and Intelligent Creation) é uma caixa de ferramentas de código aberto para criação e edição de imagens e vídeos, desenvolvida pelo projeto OpenMMLab. Ele visa fornecer um conjunto abrangente de ferramentas para pesquisadores e entusiastas de inteligência artificial generativa (AIGC) que desejam explorar a geração e edição avançada de mídias visuais.
An advanced and powerful inpainting algorithm named PowerPaint is released in our repository. Click to View
We are excited to announce the release of MMagic v1.0.0 that inherits from MMEditing and MMGeneration.
After iterative updates with OpenMMLab 2.0 framework and merged with MMGeneration, MMEditing has become a powerful tool that supports low-level algorithms based on both GAN and CNN. Today, MMEditing embraces Generative AI and transforms into a more advanced and comprehensive AIGC toolkit: MMagic (Multimodal Advanced, Generative, and Intelligent Creation). MMagic will provide more agile and flexible experimental support for researchers and AIGC enthusiasts, and help you on your AIGC exploration journey.
We highlight the following new features.
1. New Models
We support 11 new models in 4 new tasks.
Text2Image / Diffusion
ControlNet
DreamBooth
Stable Diffusion
Disco Diffusion
GLIDE
Guided Diffusion
3D-aware Generation
EG3D
Image Restoration
NAFNet
Restormer
SwinIR
Image Colorization
InstColorization
2. Magic Diffusion Model
For the Diffusion Model, we provide the following "magic" :
Support image generation based on Stable Diffusion and Disco Diffusion.
Support Finetune methods such as Dreambooth and DreamBooth LoRA.
Support controllability in text-to-image generation using ControlNet.
Support acceleration and optimization strategies based on xFormers to improve training and inference efficiency.
Support video generation based on MultiFrame Render.
Support calling basic models and sampling strategies through DiffuserWrapper.
3. Upgraded Framework
By using MMEngine and MMCV of OpenMMLab 2.0 framework, MMagic has upgraded in the following new features:
Refactor DataSample to support the combination and splitting of batch dimensions.
Refactor DataPreprocessor and unify the data format for various tasks during training and inference.
Refactor MultiValLoop and MultiTestLoop, supporting the evaluation of both generation-type metrics (e.g. FID) and reconstruction-type metrics (e.g. SSIM), and supporting the evaluation of multiple datasets at once.
Support visualization on local files or using tensorboard and wandb.
Support for 33+ algorithms accelerated by Pytorch 2.0.
MMagic has supported all the tasks, models, metrics, and losses in MMEditing and MMGeneration and unifies interfaces of all components based on MMEngine 😍.
Please refer to changelog.md for details and release history.
MMagic (Multimodal Advanced, Generative, and Intelligent Creation) is an advanced and comprehensive AIGC toolkit that inherits from MMEditing and MMGeneration. It is an open-source image and video editing&generating toolbox based on PyTorch. It is a part of the OpenMMLab project.
Currently, MMagic support multiple image and video generation/editing tasks.
MMagic provides state-of-the-art generative models to process, edit and synthesize images and videos.
Powerful and Popular Applications
MMagic supports popular and contemporary image restoration, text-to-image, 3D-aware generation, inpainting, matting, super-resolution and generation applications. Specifically, MMagic supports fine-tuning for stable diffusion and many exciting diffusion's application such as ControlNet Animation with SAM. MMagic also supports GAN interpolation, GAN projection, GAN manipulations and many other popular GAN’s applications. It’s time to begin your AIGC exploration journey!
Efficient Framework
By using MMEngine and MMCV of OpenMMLab 2.0 framework, MMagic decompose the editing framework into different modules and one can easily construct a customized editor framework by combining different modules. We can define the training process just like playing with Legos and provide rich components and strategies. In MMagic, you can complete controls on the training process with different levels of APIs. With the support of MMSeparateDistributedDataParallel, distributed training for dynamic architectures can be easily implemented.
✨ Best Practice
The best practice on our main branch works with Python 3.9+ and PyTorch 2.0+.
🙌 Contributing
More and more community contributors are joining us to make our repo better. Some recent projects are contributed by the community including:
Projects is opened to make it easier for everyone to add projects to MMagic.
We appreciate all contributions to improve MMagic. Please refer to CONTRIBUTING.md in MMCV and CONTRIBUTING.md in MMEngine for more details about the contributing guideline.
🛠️ Installation
MMagic depends on PyTorch, MMEngine and MMCV.
Below are quick steps for installation.
Step 3.
Verify MMagic has been successfully installed.
cd ~
python -c "import mmagic; print(mmagic.__version__)"
# Example output: 1.0.0
Getting Started
After installing MMagic successfully, now you are able to play with MMagic! To generate an image from text, you only need several lines of codes by MMagic!
from mmagic.apis import MMagicInferencer
sd_inferencer = MMagicInferencer(model_name='stable_diffusion')
text_prompts = 'A panda is having dinner at KFC'
result_out_dir = 'output/sd_res.png'
sd_inferencer.infer(text=text_prompts, result_out_dir=result_out_dir)
MMagic is an open source project that is contributed by researchers and engineers from various colleges and companies. We wish that the toolbox and benchmark could serve the growing research community by providing a flexible toolkit to reimplement existing methods and develop their own new methods.
We appreciate all the contributors who implement their methods or add new features, as well as users who give valuable feedbacks. Thank you all!
🖊️ Citation
If MMagic is helpful to your research, please cite it as below.
@misc{mmagic2023,
title = {{MMagic}: {OpenMMLab} Multimodal Advanced, Generative, and Intelligent Creation Toolbox},
author = {{MMagic Contributors}},
howpublished = {\url{https://github.com/open-mmlab/mmagic}},
year = {2023}
}
@misc{mmediting2022,
title = {{MMEditing}: {OpenMMLab} Image and Video Editing Toolbox},
author = {{MMEditing Contributors}},
howpublished = {\url{https://github.com/open-mmlab/mmediting}},
year = {2022}
}
🎫 License
This project is released under the Apache 2.0 license.
Please refer to LICENSES for the careful check, if you are using our code for commercial matters.
🏗️ ️OpenMMLab Family
MMEngine: OpenMMLab foundational library for training deep learning models.
MMCV: OpenMMLab foundational library for computer vision.
Modelos de Geração de Estado da Arte: Oferece suporte a modelos generativos avançados para processamento, edição e síntese de imagens e vídeos.
Tarefas Suportadas: O MMagic suporta várias tarefas contemporâneas, incluindo:
Geração de imagens a partir de texto (Text-to-Image) usando modelos como Stable Diffusion e Disco Diffusion.
Restauração de imagens.
Geração consciente de 3D.
Inpainting (preenchimento de áreas em imagens).
Super-resolução de imagens.
Framework Eficiente: Baseado na arquitetura OpenMMLab 2.0, o MMagic é modular, permitindo que os usuários construam seus próprios fluxos de trabalho de edição e treinem modelos de forma flexível.
Suporte para Treinamento Distribuído: O MMagic facilita o treinamento distribuído para arquiteturas dinâmicas, permitindo que pesquisadores e desenvolvedores amplifiquem sua capacidade computacional.
Documentação e Comunidade: O repositório inclui documentação extensa para ajudar os usuários a começar a trabalhar com as ferramentas e modelos disponíveis e tem uma comunidade ativa contribuindo com novos projetos e melhorias.
Novidades Recentes (Versão 1.2.0):
Introdução de algoritmos avançados, como o PowerPaint para inpainting.
Adição de novos modelos e aprimoramento de várias funcionalidades para suportar tarefas como geração de vídeo e controle na geração de imagens.
Objetivo Principal:
O MMagic é projetado para ser uma ferramenta poderosa para pesquisadores e criadores que desejam explorar novas abordagens em geração de mídia, fornecendo recursos para a implementação e experimentação de modelos de IA generativa.
Instalação:
Os usuários podem instalar o MMagic facilmente através do gerenciador de pacotes pip, seguindo as instruções na documentação.
Esse repositório é uma ótima escolha para aqueles interessados em trabalhar com IA generativa, permitindo acesso a ferramentas modernas e de alta performance para edição e geração de mídias.