Skip to content

โœญ MAGNETRON โ„ข โœญ: ๐Ÿค— Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch

License

Notifications You must be signed in to change notification settings

GCABC123/magnetron-diffusers

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– THE ABC 123 GROUP โ„ข ๐Ÿค–

๐ŸŒ GENERAL CONSULTING ABC 123 BY OSAROPRIME โ„ข.

๐ŸŒ ABC 123 USA โ„ข

๐ŸŒ ABC 123 DESYGN โ„ข

๐ŸŒ ABC 123 FILMS โ„ข

=============================================================

             ๐ŸŒ MAGENTRON โ„ข ๐ŸŒ

๐ŸŒ ARTIFICIAL INTELLIGENCE 2.0 โ„ข : IMAGINATION PROXIA (LIBRARY OF DIFFUSION MODELS)

*๏ธโƒฃ๐Ÿ“ถ๐Ÿค–

REQUIREMENTS:

[*] Software Requirements: Google Colab/Jupyter Notebook, Python, Tensor Flow

[*] HARDWARE REQUIREMENTS: fast GPU Graphics Processing Unit)

[*] DEPENDENCIES: INCLUDED

CLICK ON THE LINKS BELOW FOR A JUPYTER NOTEBOOK ON IMAGINATION PROXIA:

๐ŸŒ https://github.com/GCABC123/magnetron.artificial-intelligence-2.0.mincloud.proxia--IMAGINATION-A1

๐ŸŒ https://github.com/GCABC123/magnetron.artificial-intelligence-2.0.mincloud.proxia--IMAGINATION-B

๐ŸŒ https://github.com/GCABC123/magnetron.artificial-intelligence-2.0.mincloud.proxia--IMAGINATION-C

๐ŸŒ https://github.com/GCABC123/magnetron.artificial-intelligence-2.0.mincloud.proxia--IMAGINATION-D

=============================================================

Prerequisite reading:

๐ŸŒ ARTIFICIAL INTELLIGENCE PRIMER โ„ข: https://www.facebook.com/artificialintelligenceprimer

๐ŸŒ ARTIFICIAL INTELLIGENCE 2.0 โ„ข DOCUMENTATION: https://www.facebook.com/aibyabc123/

๐ŸŒ MEMBER'S CLUB โ„ข DOCUMENTATION - https://www.facebook.com/abc123membersclub/

๐Ÿ‘‘ INCLUDED STICKERS/SIGN:

FIND STICKERS HERE: https://bit.ly/3B8D3lE

PROMOTIONAL MATERIAL FOR ๐— ๐—”๐—š๐—ก๐—˜๐—ง๐—ฅ๐—ข๐—ก ๐—ง๐—˜๐—–๐—›๐—ก๐—ข๐—Ÿ๐—ข๐—š๐—ฌ โ„ข. (CUSTOM GRAPHICS BY ๐—”๐—•๐—– ๐Ÿญ๐Ÿฎ๐Ÿฏ ๐——๐—˜๐—ฆ๐—ฌ๐—š๐—ก โ„ข/๐—ข๐—ฆ๐—”๐—ฅ๐—ข ๐—›๐—”๐—ฅ๐—ฅ๐—œ๐—ข๐—ง๐—ง). THE ๐— ๐—”๐—š๐—ก๐—˜๐—ง๐—ฅ๐—ข๐—ก ๐—ง๐—˜๐—–๐—›๐—ก๐—ข๐—Ÿ๐—ข๐—š๐—ฌ โ„ข SYMBOL/LOGO IS A TRADEMARK OF ๐—ง๐—›๐—˜ ๐—”๐—•๐—– ๐Ÿญ๐Ÿฎ๐Ÿฏ ๐—š๐—ฅ๐—ข๐—จ๐—ฃ โ„ข FOR ๐— ๐—”๐—š๐—ก๐—˜๐—ง๐—ฅ๐—ข๐—ก ๐—ง๐—˜๐—–๐—›๐—ก๐—ข๐—Ÿ๐—ข๐—š๐—ฌ โ„ข. ๐—ง๐—›๐—˜ ๐—”๐—•๐—– ๐Ÿญ๐Ÿฎ๐Ÿฏ ๐—š๐—ฅ๐—ข๐—จ๐—ฃ โ„ข SYMBOL/LOGO IS A TRADEMARK OF ๐—ง๐—›๐—˜ ๐—”๐—•๐—– ๐Ÿญ๐Ÿฎ๐Ÿฏ ๐—š๐—ฅ๐—ข๐—จ๐—ฃ โ„ข. *๏ธโƒฃ๐Ÿ“ถ๐Ÿค–

PROMOTIONAL MATERIAL FOR ๐—”๐—ฅ๐—ง๐—œ๐—™๐—œ๐—–๐—œ๐—”๐—Ÿ ๐—œ๐—ก๐—ง๐—˜๐—Ÿ๐—Ÿ๐—œ๐—š๐—˜๐—ก๐—–๐—˜ ๐Ÿฎ.๐Ÿฌ โ„ข. (CUSTOM GRAPHICS BY ๐—”๐—•๐—– ๐Ÿญ๐Ÿฎ๐Ÿฏ ๐——๐—˜๐—ฆ๐—ฌ๐—š๐—ก โ„ข/๐—ข๐—ฆ๐—”๐—ฅ๐—ข ๐—›๐—”๐—ฅ๐—ฅ๐—œ๐—ข๐—ง๐—ง) THE ๐——๐—ฅ๐—”๐—š๐—ข๐—ก & ๐—–๐—ฅ๐—ข๐—ช๐—ก ๐Ÿ‘‘ SYMBOL/LOGO IS A TRADEMARK OF ๐—ง๐—›๐—˜ ๐—”๐—•๐—– ๐Ÿญ๐Ÿฎ๐Ÿฏ ๐—š๐—ฅ๐—ข๐—จ๐—ฃ โ„ข ASSOCIATED WITH TECHNOLOGY. ๐—ง๐—›๐—˜ ๐—”๐—•๐—– ๐Ÿญ๐Ÿฎ๐Ÿฏ ๐—š๐—ฅ๐—ข๐—จ๐—ฃ โ„ข SYMBOL/LOGO IS A TRADEMARK OF ๐—ง๐—›๐—˜ ๐—”๐—•๐—– ๐Ÿญ๐Ÿฎ๐Ÿฏ ๐—š๐—ฅ๐—ข๐—จ๐—ฃ โ„ข. You must display the included stickers/signs (so that it is clearly visible) if you are working with MAGNETRON โ„ข TECHNOLOGY for the purposes of determining whether you want to purchase a technology license or not. This includes but is not limited to public technology displays, trade shows, technology expos, media appearances, Investor events, Computers (exterior), MINDCLOUD STORAGE (e.g server room doors, render farm room doors) etc.

NOTE: IMAGINATION PROXIA A IS DESCRIBED IN THE ๐—”๐—ฅ๐—ง๐—œ๐—™๐—œ๐—–๐—œ๐—”๐—Ÿ ๐—œ๐—ก๐—ง๐—˜๐—Ÿ๐—Ÿ๐—œ๐—š๐—˜๐—ก๐—–๐—˜ ๐Ÿฎ.๐Ÿฌ โ„ข DOCUMENTATION.

+++++++++++++++++++++++++++++++++++++++++++



GitHub GitHub release Contributor Covenant

๐Ÿค— Diffusers is the go-to library for state-of-the-art pretrained diffusion models for generating images, audio, and even 3D structures of molecules. Whether you're looking for a simple inference solution or training your own diffusion models, ๐Ÿค— Diffusers is a modular toolbox that supports both. Our library is designed with a focus on usability over performance, simple over easy, and customizability over abstractions.

๐Ÿค— Diffusers offers three core components:

  • State-of-the-art diffusion pipelines that can be run in inference with just a few lines of code.
  • Interchangeable noise schedulers for different diffusion speeds and output quality.
  • Pretrained models that can be used as building blocks, and combined with schedulers, for creating your own end-to-end diffusion systems.

Installation

We recommend installing ๐Ÿค— Diffusers in a virtual environment from PyPi or Conda. For more details about installing PyTorch and Flax, please refer to their official documentation.

PyTorch

With pip (official package):

pip install --upgrade diffusers[torch]

With conda (maintained by the community):

conda install -c conda-forge diffusers

Flax

With pip (official package):

pip install --upgrade diffusers[flax]

Apple Silicon (M1/M2) support

Please refer to the How to use Stable Diffusion in Apple Silicon guide.

Quickstart

Generating outputs is super easy with ๐Ÿค— Diffusers. To generate an image from text, use the from_pretrained method to load any pretrained diffusion model (browse the Hub for 4000+ checkpoints):

from diffusers import DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
pipeline.to("cuda")
pipeline("An image of a squirrel in Picasso style").images[0]

You can also dig into the models and schedulers toolbox to build your own diffusion system:

from diffusers import DDPMScheduler, UNet2DModel
from PIL import Image
import torch
import numpy as np

scheduler = DDPMScheduler.from_pretrained("google/ddpm-cat-256")
model = UNet2DModel.from_pretrained("google/ddpm-cat-256").to("cuda")
scheduler.set_timesteps(50)

sample_size = model.config.sample_size
noise = torch.randn((1, 3, sample_size, sample_size)).to("cuda")
input = noise

for t in scheduler.timesteps:
    with torch.no_grad():
        noisy_residual = model(input, t).sample
        prev_noisy_sample = scheduler.step(noisy_residual, t, input).prev_sample
        input = prev_noisy_sample

image = (input / 2 + 0.5).clamp(0, 1)
image = image.cpu().permute(0, 2, 3, 1).numpy()[0]
image = Image.fromarray((image * 255).round().astype("uint8"))
image

Check out the Quickstart to launch your diffusion journey today!

How to navigate the documentation

Documentation What can I learn?
Tutorial A basic crash course for learning how to use the library's most important features like using models and schedulers to build your own diffusion system, and training your own diffusion model.
Loading Guides for how to load and configure all the components (pipelines, models, and schedulers) of the library, as well as how to use different schedulers.
Pipelines for inference Guides for how to use pipelines for different inference tasks, batched generation, controlling generated outputs and randomness, and how to contribute a pipeline to the library.
Optimization Guides for how to optimize your diffusion model to run faster and consume less memory.
Training Guides for how to train a diffusion model for different tasks with different training techniques.

Supported pipelines

Pipeline Paper Tasks
alt_diffusion AltDiffusion Image-to-Image Text-Guided Generation
audio_diffusion Audio Diffusion Unconditional Audio Generation
controlnet ControlNet with Stable Diffusion Image-to-Image Text-Guided Generation
cycle_diffusion Cycle Diffusion Image-to-Image Text-Guided Generation
dance_diffusion Dance Diffusion Unconditional Audio Generation
ddpm Denoising Diffusion Probabilistic Models Unconditional Image Generation
ddim Denoising Diffusion Implicit Models Unconditional Image Generation
latent_diffusion High-Resolution Image Synthesis with Latent Diffusion Models Text-to-Image Generation
latent_diffusion High-Resolution Image Synthesis with Latent Diffusion Models Super Resolution Image-to-Image
latent_diffusion_uncond High-Resolution Image Synthesis with Latent Diffusion Models Unconditional Image Generation
paint_by_example Paint by Example: Exemplar-based Image Editing with Diffusion Models Image-Guided Image Inpainting
pndm Pseudo Numerical Methods for Diffusion Models on Manifolds Unconditional Image Generation
score_sde_ve Score-Based Generative Modeling through Stochastic Differential Equations Unconditional Image Generation
score_sde_vp Score-Based Generative Modeling through Stochastic Differential Equations Unconditional Image Generation
semantic_stable_diffusion Semantic Guidance Text-Guided Generation
stable_diffusion_text2img Stable Diffusion Text-to-Image Generation
stable_diffusion_img2img Stable Diffusion Image-to-Image Text-Guided Generation
stable_diffusion_inpaint Stable Diffusion Text-Guided Image Inpainting
stable_diffusion_panorama MultiDiffusion Text-to-Panorama Generation
stable_diffusion_pix2pix InstructPix2Pix Text-Guided Image Editing
stable_diffusion_pix2pix_zero Zero-shot Image-to-Image Translation Text-Guided Image Editing
stable_diffusion_attend_and_excite Attend and Excite for Stable Diffusion Text-to-Image Generation
stable_diffusion_self_attention_guidance Self-Attention Guidance Text-to-Image Generation
stable_diffusion_image_variation Stable Diffusion Image Variations Image-to-Image Generation
stable_diffusion_latent_upscale Stable Diffusion Latent Upscaler Text-Guided Super Resolution Image-to-Image
stable_diffusion_2 Stable Diffusion 2 Text-to-Image Generation
stable_diffusion_2 Stable Diffusion 2 Text-Guided Image Inpainting
stable_diffusion_2 Depth-Conditional Stable Diffusion Depth-to-Image Generation
stable_diffusion_2 Stable Diffusion 2 Text-Guided Super Resolution Image-to-Image
stable_diffusion_safe Safe Stable Diffusion Text-Guided Generation
stable_unclip Stable unCLIP Text-to-Image Generation
stable_unclip Stable unCLIP Image-to-Image Text-Guided Generation
stochastic_karras_ve Elucidating the Design Space of Diffusion-Based Generative Models Unconditional Image Generation
unclip Hierarchical Text-Conditional Image Generation with CLIP Latents Text-to-Image Generation
versatile_diffusion Versatile Diffusion: Text, Images and Variations All in One Diffusion Model Text-to-Image Generation
versatile_diffusion Versatile Diffusion: Text, Images and Variations All in One Diffusion Model Image Variations Generation
versatile_diffusion Versatile Diffusion: Text, Images and Variations All in One Diffusion Model Dual Image and Text Guided Generation
vq_diffusion Vector Quantized Diffusion Model for Text-to-Image Synthesis Text-to-Image Generation

Credits

This library concretizes previous work by many different authors and would not have been possible without their great research and implementations. We'd like to thank, in particular, the following implementations which have helped us in our development and without which the API could not have been as polished today:

  • @CompVis' latent diffusion models library, available here
  • @hojonathanho original DDPM implementation, available here as well as the extremely useful translation into PyTorch by @pesser, available here
  • @ermongroup's DDIM implementation, available here
  • @yang-song's Score-VE and Score-VP implementations, available here

We also want to thank @heejkoo for the very helpful overview of papers, code and resources on diffusion models, available here as well as @crowsonkb and @rromb for useful discussions and insights.

Citation

@misc{von-platen-etal-2022-diffusers,
  author = {Patrick von Platen and Suraj Patil and Anton Lozhkov and Pedro Cuenca and Nathan Lambert and Kashif Rasul and Mishig Davaadorj and Thomas Wolf},
  title = {Diffusers: State-of-the-art diffusion models},
  year = {2022},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/huggingface/diffusers}}
}

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.7%
  • Other 0.3%