diffusersplus


Namediffusersplus JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/kadirnar/Custom-Diffusion
Summarydiffusersplus: A collection of pipelines for Stable Diffusion and ControlNet models.
upload_time2023-08-19 12:11:18
maintainer
docs_urlNone
authorkadirnar
requires_python>=3.6
licenseApache License 2.0
keywords machine-learning deep-learning pytorch diffusion diffusion models controlnet stable diffusion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
<h2>
     Custom Diffusion: Creating Video from Frame Using Diffusion
</h2>
<div>
    <a href="https://pepy.tech/project/custom_diffusion"><img src="https://pepy.tech/badge/custom_diffusion" alt="downloads"></a>
    <a href="https://badge.fury.io/py/custom_diffusion"><img src="https://badge.fury.io/py/custom_diffusion.svg" alt="pypi version"></a>
    <a href="https://huggingface.co/spaces/ArtGAN/Stable-Diffusion-ControlNet-WebUI"><img src="https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-sm.svg" alt="HuggingFace Spaces"></a>
</div>
</div>


## Installation
```bash
pip install diffusersplus
```

## Usage

### Stable Diffusion Text2Image Generate:
```python
from diffusersplus.automodel import diffusion_pipeline

model = diffusion_pipeline(
    task_id="stable-txt2img", 
    stable_model_id="dreamlike-art/dreamlike-anime-1.0", 
    scheduler_name="DDIM"
)

output = model(
    prompt="A photo of a anime character",
    negative_prompt="bad",
    num_images_per_prompt=1,
    num_inference_steps=30,
    guidance_scale=7.0,
    guidance_rescale=0.0,
    generator_seed=0,
    height=512,
    width=512,
)
```
### Stable Diffusion Image2Image Generate:

```python	
from diffusersplus.automodel import diffusion_pipeline

model = diffusion_pipeline(
    task_id="stable-img2img", stable_model_id="dreamlike-art/dreamlike-anime-1.0", scheduler_name="DDIM"
)

output = model(
    image_path="../data/image.png",
    prompt="A photo of a cat.",
    negative_prompt="bad",
    num_images_per_prompt=1,
    num_inference_steps=50,
    guidance_scale=7.0,
    strength=0.5,
    generator_seed=0,
    resize_type="center_crop_and_resize",
    crop_size=512,
    height=512,
    width=512,
)

### Stable Diffusion Upscale:
```python
from diffusersplus.automodel import diffusion_pipeline

model = diffusion_pipeline(
    task_id="stable-upscale", stable_model_id="stabilityai/stable-diffusion-x4-upscaler", scheduler_name="DDIM"
)

output = model(
    image_path="../data/image.png",
    prompt="A photo of a anime character.",
    negative_prompt="bad",
    resize_type="center_crop_and_resize",
    noise_level=20,
    num_images_per_prompt=1,
    num_inference_steps=20,
    guidance_scale=7.0,
    generator_seed=0,
)
```
### Controlnet:
```python
from diffusersplus.automodel import diffusion_pipeline

model = diffusion_pipeline(
    task_id="controlnet",
    stable_model_id="dreamlike-art/dreamlike-anime-1.0",
    controlnet_model_id="lllyasviel/sd-controlnet-canny",
    scheduler_name="DDIM",
)
output = model(
    image_path="../data/image.png",
    prompt="A photo of cat.",
    negative_prompt="bad",
    height=512,
    width=512,
    preprocess_type="Canny",
    resize_type="center_crop_and_resize",
    guess_mode=False,
    num_images_per_prompt=1,
    num_inference_steps=50,
    guidance_scale=7.0,
    controlnet_conditioning_scale=0.2,
    generator_seed=0,
)
```

### Controlnet Inpaint
```python
from diffusersplus.automodel import diffusion_pipeline

model = diffusion_pipeline(
    task_id="controlnet-inpaint",
    stable_model_id="dreamlike-art/dreamlike-anime-1.0",
    controlnet_model_id="lllyasviel/sd-controlnet-canny",
    scheduler_name="DDIM",
)
output = model(
    image_path="../data/image.png",
    mask_path="../data/mask_image.png",
    prompt="A photo of a cat.",
    negative_prompt="bad",
    height=512,
    width=512,
    preprocess_type="Canny",
    resize_type="center_crop_and_resize",
    strength=0.5,
    guess_mode=False,
    num_images_per_prompt=1,
    num_inference_steps=50,
    guidance_scale=7.0,
    controlnet_conditioning_scale=1.0,
    generator_seed=0,
)
```

### Controlnet Image2Image
```python
from diffusersplus.automodel import diffusion_pipeline

model = diffusion_pipeline(
    task_id="controlnet-img2img",
    stable_model_id="dreamlike-art/dreamlike-anime-1.0",
    controlnet_model_id="lllyasviel/sd-controlnet-canny",
    scheduler_name="DDIM",
)
output = model(
    image_path="../data/image.png",
    prompt="A photo of a cat.",
    negative_prompt="bad",
    height=512,
    width=512,
    preprocess_type="Canny",
    resize_type="center_crop_and_resize",
    guess_mode=False,
    num_images_per_prompt=1,
    num_inference_steps=20,
    guidance_scale=7.0,
    controlnet_conditioning_scale=1.0,
    strength=0.5,
    generator_seed=0,
)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kadirnar/Custom-Diffusion",
    "name": "diffusersplus",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "machine-learning,deep-learning,pytorch,diffusion,diffusion models,controlnet,stable diffusion",
    "author": "kadirnar",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/53/76/916788c0fabe67855b99f20e0c8a40d6e01cbc9e097493c0757ddd6fa88f/diffusersplus-0.0.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\r\n<h2>\r\n     Custom Diffusion: Creating Video from Frame Using Diffusion\r\n</h2>\r\n<div>\r\n    <a href=\"https://pepy.tech/project/custom_diffusion\"><img src=\"https://pepy.tech/badge/custom_diffusion\" alt=\"downloads\"></a>\r\n    <a href=\"https://badge.fury.io/py/custom_diffusion\"><img src=\"https://badge.fury.io/py/custom_diffusion.svg\" alt=\"pypi version\"></a>\r\n    <a href=\"https://huggingface.co/spaces/ArtGAN/Stable-Diffusion-ControlNet-WebUI\"><img src=\"https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-sm.svg\" alt=\"HuggingFace Spaces\"></a>\r\n</div>\r\n</div>\r\n\r\n\r\n## Installation\r\n```bash\r\npip install diffusersplus\r\n```\r\n\r\n## Usage\r\n\r\n### Stable Diffusion Text2Image Generate:\r\n```python\r\nfrom diffusersplus.automodel import diffusion_pipeline\r\n\r\nmodel = diffusion_pipeline(\r\n    task_id=\"stable-txt2img\", \r\n    stable_model_id=\"dreamlike-art/dreamlike-anime-1.0\", \r\n    scheduler_name=\"DDIM\"\r\n)\r\n\r\noutput = model(\r\n    prompt=\"A photo of a anime character\",\r\n    negative_prompt=\"bad\",\r\n    num_images_per_prompt=1,\r\n    num_inference_steps=30,\r\n    guidance_scale=7.0,\r\n    guidance_rescale=0.0,\r\n    generator_seed=0,\r\n    height=512,\r\n    width=512,\r\n)\r\n```\r\n### Stable Diffusion Image2Image Generate:\r\n\r\n```python\t\r\nfrom diffusersplus.automodel import diffusion_pipeline\r\n\r\nmodel = diffusion_pipeline(\r\n    task_id=\"stable-img2img\", stable_model_id=\"dreamlike-art/dreamlike-anime-1.0\", scheduler_name=\"DDIM\"\r\n)\r\n\r\noutput = model(\r\n    image_path=\"../data/image.png\",\r\n    prompt=\"A photo of a cat.\",\r\n    negative_prompt=\"bad\",\r\n    num_images_per_prompt=1,\r\n    num_inference_steps=50,\r\n    guidance_scale=7.0,\r\n    strength=0.5,\r\n    generator_seed=0,\r\n    resize_type=\"center_crop_and_resize\",\r\n    crop_size=512,\r\n    height=512,\r\n    width=512,\r\n)\r\n\r\n### Stable Diffusion Upscale:\r\n```python\r\nfrom diffusersplus.automodel import diffusion_pipeline\r\n\r\nmodel = diffusion_pipeline(\r\n    task_id=\"stable-upscale\", stable_model_id=\"stabilityai/stable-diffusion-x4-upscaler\", scheduler_name=\"DDIM\"\r\n)\r\n\r\noutput = model(\r\n    image_path=\"../data/image.png\",\r\n    prompt=\"A photo of a anime character.\",\r\n    negative_prompt=\"bad\",\r\n    resize_type=\"center_crop_and_resize\",\r\n    noise_level=20,\r\n    num_images_per_prompt=1,\r\n    num_inference_steps=20,\r\n    guidance_scale=7.0,\r\n    generator_seed=0,\r\n)\r\n```\r\n### Controlnet:\r\n```python\r\nfrom diffusersplus.automodel import diffusion_pipeline\r\n\r\nmodel = diffusion_pipeline(\r\n    task_id=\"controlnet\",\r\n    stable_model_id=\"dreamlike-art/dreamlike-anime-1.0\",\r\n    controlnet_model_id=\"lllyasviel/sd-controlnet-canny\",\r\n    scheduler_name=\"DDIM\",\r\n)\r\noutput = model(\r\n    image_path=\"../data/image.png\",\r\n    prompt=\"A photo of cat.\",\r\n    negative_prompt=\"bad\",\r\n    height=512,\r\n    width=512,\r\n    preprocess_type=\"Canny\",\r\n    resize_type=\"center_crop_and_resize\",\r\n    guess_mode=False,\r\n    num_images_per_prompt=1,\r\n    num_inference_steps=50,\r\n    guidance_scale=7.0,\r\n    controlnet_conditioning_scale=0.2,\r\n    generator_seed=0,\r\n)\r\n```\r\n\r\n### Controlnet Inpaint\r\n```python\r\nfrom diffusersplus.automodel import diffusion_pipeline\r\n\r\nmodel = diffusion_pipeline(\r\n    task_id=\"controlnet-inpaint\",\r\n    stable_model_id=\"dreamlike-art/dreamlike-anime-1.0\",\r\n    controlnet_model_id=\"lllyasviel/sd-controlnet-canny\",\r\n    scheduler_name=\"DDIM\",\r\n)\r\noutput = model(\r\n    image_path=\"../data/image.png\",\r\n    mask_path=\"../data/mask_image.png\",\r\n    prompt=\"A photo of a cat.\",\r\n    negative_prompt=\"bad\",\r\n    height=512,\r\n    width=512,\r\n    preprocess_type=\"Canny\",\r\n    resize_type=\"center_crop_and_resize\",\r\n    strength=0.5,\r\n    guess_mode=False,\r\n    num_images_per_prompt=1,\r\n    num_inference_steps=50,\r\n    guidance_scale=7.0,\r\n    controlnet_conditioning_scale=1.0,\r\n    generator_seed=0,\r\n)\r\n```\r\n\r\n### Controlnet Image2Image\r\n```python\r\nfrom diffusersplus.automodel import diffusion_pipeline\r\n\r\nmodel = diffusion_pipeline(\r\n    task_id=\"controlnet-img2img\",\r\n    stable_model_id=\"dreamlike-art/dreamlike-anime-1.0\",\r\n    controlnet_model_id=\"lllyasviel/sd-controlnet-canny\",\r\n    scheduler_name=\"DDIM\",\r\n)\r\noutput = model(\r\n    image_path=\"../data/image.png\",\r\n    prompt=\"A photo of a cat.\",\r\n    negative_prompt=\"bad\",\r\n    height=512,\r\n    width=512,\r\n    preprocess_type=\"Canny\",\r\n    resize_type=\"center_crop_and_resize\",\r\n    guess_mode=False,\r\n    num_images_per_prompt=1,\r\n    num_inference_steps=20,\r\n    guidance_scale=7.0,\r\n    controlnet_conditioning_scale=1.0,\r\n    strength=0.5,\r\n    generator_seed=0,\r\n)\r\n```\r\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "diffusersplus: A collection of pipelines for Stable Diffusion and ControlNet models.",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/kadirnar/Custom-Diffusion"
    },
    "split_keywords": [
        "machine-learning",
        "deep-learning",
        "pytorch",
        "diffusion",
        "diffusion models",
        "controlnet",
        "stable diffusion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5376916788c0fabe67855b99f20e0c8a40d6e01cbc9e097493c0757ddd6fa88f",
                "md5": "4cddf4e88717669139e190753e4de000",
                "sha256": "abb95817ac7b215b7e8a4ab43177f7791556fe5bc4fa051de4c26d03ce5d83df"
            },
            "downloads": -1,
            "filename": "diffusersplus-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4cddf4e88717669139e190753e4de000",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 17973,
            "upload_time": "2023-08-19T12:11:18",
            "upload_time_iso_8601": "2023-08-19T12:11:18.568563Z",
            "url": "https://files.pythonhosted.org/packages/53/76/916788c0fabe67855b99f20e0c8a40d6e01cbc9e097493c0757ddd6fa88f/diffusersplus-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-19 12:11:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kadirnar",
    "github_project": "Custom-Diffusion",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "diffusersplus"
}
        
Elapsed time: 0.10667s