Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffusion_image_gen-0.4.1.tar.gz (59.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffusion_image_gen-0.4.1-py3-none-any.whl (79.6 kB view details)

Uploaded Python 3

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

Hashes for diffusion_image_gen-0.4.1.tar.gz
Algorithm Hash digest
SHA256 6933a186f0fe844787e6fa4ef8be761a49de48599d857cc8704b8d178e6e94d4
MD5 c4745a5aa922e31a4abd51d8c57189b0
BLAKE2b-256 722f670ec392733e8ac37cf684f70643f19005df171d2a7d8c49fede3569f887

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diffusion_image_gen-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for diffusion_image_gen-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9acfd87a8e2a9c060d0190ba6dc49ac38acc95b905b85e089c26aca3c76d3c76
MD5 eb0224f33f6f359c5984b9b86f0e9c82
BLAKE2b-256 721439268e6b0a316a080102b110384aa9b6c241083f50d80ce7c710f9a7f49f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page