Diffusion-Based Image Generation
Overview
This project implements diffusion-based generative models for image synthesis. It provides a comprehensive framework for training and using diffusion models, with support for various diffusion processes, noise schedules, and sampling methods.
Features
- Multiple Diffusion Processes: Support for Variance Exploding (VE), Variance Preserving (VP), and other diffusion types
- Customizable Noise Schedules: Linear, Cosine, and custom noise schedules
- Various Samplers: Euler-Maruyama, Exponential Integrator, ODE Probability Flow, and Predictor-Corrector samplers
- Advanced Generation Capabilities:
- Unconditional image generation
- Class-conditional image generation
- Image colorization
- Image inpainting/imputation
- Interactive Dashboard: Built with Streamlit for easy model interaction, accessible via a simple CLI command.
Installation
Using pip (Recommended)
You can install the package directly from PyPI:
pip install diffusion-image-gen
From Source (for development)
Clone the repository:
git clone https://github.com/HectorTablero/image-gen.git
cd image-gen
pip install -e .
Usage
Basic Generation
from diffusion_image_gen import GenerativeModel
# Load a pre-trained model
# Note: You will need to have a model file (.pt or .pth) available.
# model = GenerativeModel.load("path/to/your/model.pth")
# Generate images
# images = model.generate(num_images=4, n_steps=500, seed=42)
Colorization
# Colorize a grayscale image
# colorized = model.colorize(grayscale_image, n_steps=500)
Image Inpainting
# Perform inpainting with a mask
# inpainted = model.imputation(image, mask, n_steps=500)
Note: The usage examples above assume you have a trained model file. The package provides the framework, but pre-trained models are not included in the base installation.
Interactive Dashboard
Run the dashboard to interact with your models using the command line:
diffusion-image-gen dashboard
This will start the Streamlit web application.
Documentation
A comprehensive version of the documentation is available at https://deepwiki.com/HectorTablero/image-gen
License
This project is licensed under the MIT License - see the LICENSE file for details.
Authors
- Héctor Tablero Díaz - hector.tablerodiaz@gmail.com
- Álvaro Martínez Gamo - alva00003@gmail.com
Metadata
Release files for diffusion-image-gen 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| diffusion_image_gen-0.4.1.tar.gz | 59.0 kB | With provenance | Details for diffusion_image_gen-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| diffusion_image_gen-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for diffusion_image_gen-0.4.1-py3-none-any.whl |
Total release size: 138.6 kB
Release files / diffusion_image_gen-0.4.1.tar.gz
| Download URL | diffusion_image_gen-0.4.1.tar.gz |
|---|---|
| Size | 59.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6933a186f0fe844787e6fa4ef8be761a49de48599d857cc8704b8d178e6e94d4
|
|
BLAKE2b-256 checksum How to use checksums |
722f670ec392733e8ac37cf684f70643f19005df171d2a7d8c49fede3569f887
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 11, 2025.
Transparency logRelease files / diffusion_image_gen-0.4.1-py3-none-any.whl
| Download URL | diffusion_image_gen-0.4.1-py3-none-any.whl |
|---|---|
| Size | 79.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9acfd87a8e2a9c060d0190ba6dc49ac38acc95b905b85e089c26aca3c76d3c76
|
|
BLAKE2b-256 checksum How to use checksums |
721439268e6b0a316a080102b110384aa9b6c241083f50d80ce7c710f9a7f49f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 11, 2025.
Transparency logSecurity for diffusion-image-gen 0.4.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for diffusion_image_gen-0.4.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 11, 2025.
Transparency logA 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.