Skip to main content

Custom Diffusion: Creating Video from Frame Using Diffusion

downloads pypi version HuggingFace Spaces

Installation

pip install custom_diffusion

Usage

# Importing the required libraries

from custom_diffusion.utils.data_utils import load_images_from_folder
from custom_diffusion import StableDiffusionControlNetGenerator
from custom_diffusion.utils.video_utils import convert_images_to_video
from custom_diffusion.demo import video_pipeline

# Creating a video from a video file
frames_path = video_pipeline(
    video_path="test.mp4",
    output_path="output.mp4",
    start_time=0,
    end_time=5,
    frame_rate=1,
)

# Creating a video from a folder of images
images_list = load_images_from_folder(frames_path)

prompt = "a anime boy"
negative_prompt = "bad"

list_prompt = [prompt] * len(images_list)
list_negative_prompt = [negative_prompt] * len(images_list)

# Generating images from a list of images
generator = StableDiffusionControlNetGenerator()

generated_image_list = generator.generate_image(
    stable_model_path="andite/anything-v4.0",
    controlnet_model_path="lllyasviel/control_v11p_sd15_canny",
    scheduler_name="EulerAncestralDiscrete",
    images_list=images_list,
    prompt=list_prompt,
    negative_prompt=list_negative_prompt,
    height=512,
    width=512,
    guess_mode=False,
    num_images_per_prompt=1,
    num_inference_steps=30,
    guidance_scale=7.0,
    controlnet_conditioning_scale=1.0,
    generator_seed=0,
    preprocess_type="Canny",
    resize_type="center_crop_and_resize",
    crop_size=512,
)

# Converting the generated images to a video
frame2video = convert_images_to_video(
    image_list=generated_image_list,
    output_file="output.mp4",
    frame_rate=5,
)

Metadata

Release files for custom-diffusion 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for custom-diffusion 0.1.9
File Size Uploaded Provenance Actions
custom_diffusion-0.1.9.tar.gz 17.0 kB Without provenance Details for custom_diffusion-0.1.9.tar.gz

Release files / custom_diffusion-0.1.9.tar.gz

Download URL custom_diffusion-0.1.9.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
35609dd81f7dc8e5e1a0fe4e037cb0c3d9e1e9405afea57b02d14631f96f31c7
BLAKE2b-256 checksum
How to use checksums
2fc1946d80681467d18d824d0ae27b43c0ecbeecbf36a3ee4ce45de54fa2d4cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Security for custom-diffusion 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page