A package for generating images with diffusion
Project description
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
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.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diffusion_image_gen-0.4.1.tar.gz.
File metadata
- Download URL: diffusion_image_gen-0.4.1.tar.gz
- Upload date:
- Size: 59.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6933a186f0fe844787e6fa4ef8be761a49de48599d857cc8704b8d178e6e94d4
|
|
| MD5 |
c4745a5aa922e31a4abd51d8c57189b0
|
|
| BLAKE2b-256 |
722f670ec392733e8ac37cf684f70643f19005df171d2a7d8c49fede3569f887
|
Provenance
The following attestation bundles were made for diffusion_image_gen-0.4.1.tar.gz:
Publisher:
pypi.yml on HectorTablero/diffusion-image-gen-pypi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffusion_image_gen-0.4.1.tar.gz -
Subject digest:
6933a186f0fe844787e6fa4ef8be761a49de48599d857cc8704b8d178e6e94d4 - Sigstore transparency entry: 210653696
- Sigstore integration time:
-
Permalink:
HectorTablero/diffusion-image-gen-pypi@35a4169e91d3c47b8bed390b5a8c75894b470bbf -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HectorTablero
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@35a4169e91d3c47b8bed390b5a8c75894b470bbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file diffusion_image_gen-0.4.1-py3-none-any.whl.
File metadata
- Download URL: diffusion_image_gen-0.4.1-py3-none-any.whl
- Upload date:
- Size: 79.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9acfd87a8e2a9c060d0190ba6dc49ac38acc95b905b85e089c26aca3c76d3c76
|
|
| MD5 |
eb0224f33f6f359c5984b9b86f0e9c82
|
|
| BLAKE2b-256 |
721439268e6b0a316a080102b110384aa9b6c241083f50d80ce7c710f9a7f49f
|
Provenance
The following attestation bundles were made for diffusion_image_gen-0.4.1-py3-none-any.whl:
Publisher:
pypi.yml on HectorTablero/diffusion-image-gen-pypi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffusion_image_gen-0.4.1-py3-none-any.whl -
Subject digest:
9acfd87a8e2a9c060d0190ba6dc49ac38acc95b905b85e089c26aca3c76d3c76 - Sigstore transparency entry: 210653701
- Sigstore integration time:
-
Permalink:
HectorTablero/diffusion-image-gen-pypi@35a4169e91d3c47b8bed390b5a8c75894b470bbf -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HectorTablero
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@35a4169e91d3c47b8bed390b5a8c75894b470bbf -
Trigger Event:
push
-
Statement type: