Skip to main content

Templates for HuggingFace Diffusers, supporting text-to-image, image-to-image, video generation, and inpainting workflows.

Project description




Sinapsis Hugging Face Diffusers

Sinapsis Hugging Face Diffusers provides a powerful and flexible no-code implementation of the Hugging Face Diffusers library. It enables users to easily configure and run diffusion pipelines for generative tasks.

🐍 Installation📦 Features▶️ Example usage🌐 Webapps📙 Documentation🔍 License

🐍 Installation

Install using your package manager of choice. We encourage the use of uv

Example with uv:

  uv pip install sinapsis-huggingface-diffusers --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-huggingface-diffusers --extra-index-url https://pypi.sinapsis.tech

[!IMPORTANT] Templates may require extra optional dependencies. For development, we recommend installing the package with all the optional dependencies:

with uv:

  uv pip install sinapsis-huggingface-diffusers[all] --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-huggingface-diffusers[all] --extra-index-url https://pypi.sinapsis.tech

📦 Features

The templates in this package include functionality to:

  • TextToImageDiffusers: Generates images from text prompts.
  • ImageToImageDiffusers: Modifies images using text-guided transformations.
  • InpaintingDiffusers: Supports selective image editing using masks or bounding boxes.
  • ImageToVideoGenXLDiffusers: Converts images into videos using the I2VGen-XL model.

▶️ Example Usage

Below is an example YAML configuration for running a Text-to-Image Diffusion pipeline using Sinapsis.

Config
agent:
  name: text_to_image

templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}

  - template_name: TextToImageDiffusers
    class_name: TextToImageDiffusers
    template_input: InputTemplate
    attributes:
      model_path: stable-diffusion-v1-5/stable-diffusion-v1-5
      device: cuda
      torch_dtype: "float16"
      enable_model_cpu_offload: false
      overwrite_images: true
      generation_params:
        prompt: "A majestic castle on top of a mountain, surrounded by clouds during sunset"
        height: 1024
        width: 1024
        num_inference_steps: 50
        guidance_scale: 7.5
        negative_prompt: "low quality, blurry, distorted"
        num_images_per_prompt: 1

  - template_name: ImageSaver
    class_name: ImageSaver
    template_input: TextToImageDiffusers
    attributes:
      save_dir: ./output_dir
      extension: png

[!IMPORTANT] The ImageSaver template correspond to the sinapsis-data-writers package. If you want to use the example, please make sure you install this packages.

To run the config, use the CLI:

sinapsis run name_of_config.yml

🌐 Webapps

Th Sinapsis web applications provide an interactive way to explore and experiment with AI models. They allow users to generate outputs, test different inputs, and visualize results in real time, making it easy to experience the capabilities of each model. Below are the available webapps and instructions to launch them.

[!IMPORTANT] To run any of the apps, you first need to clone this repo:

git clone git@github.com:Sinapsis-ai/sinapsis-huggingface.git
cd sinapsis-huggingface

[!NOTE] If you'd like to enable external app sharing in Gradio, export GRADIO_SHARE_APP=True

[!NOTE] Agent configuration can be changed through the AGENT_CONFIG_PATH env var. You can check the available configurations in each package configs folder.

🐳 Build with Docker

IMPORTANT The docker image depends on the sinapsis-nvidia:base image. To build it, refer to the [official sinapsis documentation](https://

  1. Build the sinapsis-huggingface image:
docker compose -f docker/compose.yaml build
  1. Start the container:
docker compose -f docker/compose_diffusers.yaml up sinapsis-huggingface-diffusers-gradio -d
  1. Check the status:
docker logs -f sinapsis-huggingface-diffusers-gradio
  1. The logs will display the URL to access the webapp, e.g.,:
Running on local URL:  http://127.0.0.1:7860

NOTE: The local URL can be different, please check the logs

  1. To stop the app:
docker compose -f docker/compose_diffusers.yaml down
📦 UV
  1. Create the virtual environment and sync the dependencies:
uv sync --frozen
  1. Install the dependencies:
uv pip install sinapsis-huggingface[all] --extra-index-url https://pypi.sinapsis.tech
  1. Run the webapp.
uv run webapps/diffusers_demo.py
  1. The terminal will display the URL to access the webapp, e.g., :
Running on local URL:  http://127.0.0.1:7860

📙 Documentation

Documentation is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.

For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.

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

sinapsis_huggingface_diffusers-0.1.7.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

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

sinapsis_huggingface_diffusers-0.1.7-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file sinapsis_huggingface_diffusers-0.1.7.tar.gz.

File metadata

File hashes

Hashes for sinapsis_huggingface_diffusers-0.1.7.tar.gz
Algorithm Hash digest
SHA256 67d3f52fcd78d20b4f68f1ac948601a2ba5d3ef2842a1cdc6a7d6fe770aff408
MD5 1a91b90d271a88b0601b585c7ce8dccc
BLAKE2b-256 3ecbc670e941089c4733bc1d73df041b878f18f2323ec1cbead91e82a620cb21

See more details on using hashes here.

File details

Details for the file sinapsis_huggingface_diffusers-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for sinapsis_huggingface_diffusers-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2ba1bfb97305ada54e3b4cdd79ac20180326de32c68e0f11c3fe75221e6b9b5c
MD5 de85b162766b3097416e61ace211e11b
BLAKE2b-256 314e09acc3380797dbce952006fc8001c6694ad1eeed0c7e8d2373323029e063

See more details on using hashes here.

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