Skip to content

Commit

Permalink
docs: version 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
R3gm committed Oct 10, 2024
1 parent 81483c1 commit d994479
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 30 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The goal of this project is to make Stable Diffusion more accessible, simple and

**Installation:**
```
pip install stablepy==0.5.0
pip install stablepy==0.5.1
```

**Usage:**
Expand Down Expand Up @@ -37,7 +37,7 @@ model = Model_Diffusers(
task_name= 'txt2img',
)

image, path_image = model(
image, info_image = model(
prompt='highly detailed portrait of an underwater city, with towering spires and domes rising up from the ocean floor',
num_steps = 30,
guidance_scale = 7.5,
Expand All @@ -61,7 +61,7 @@ model = Model_Diffusers(
task_name= 'canny',
)

images, path_images = model(
images, info_image = model(
prompt='highly detailed portrait of an underwater city, with towering spires and domes rising up from the ocean floor',
num_steps = 30,
image_resolution = 768,
Expand All @@ -78,9 +78,14 @@ images, path_images = model(

images[1]
```
**📖 News:**
**📖 New Update Details:**

🔥 Version 0.5.0: New Update Details
🔥 Version 0.5.1:

- After generation, PIL images are now returned along with sublists containing the seeds, image paths, and metadata with the parameters used in generation. `[pil_image], [seed, image_path, metadata]`
- The use of `image_previews=True` has been improved, and now preview images can be obtained during the generation steps using a generator. For more details, refer to the Colab notebook.

🔥 Version 0.5.0:

- Fix LoRA SDXL compatibility.
- Latent upscaler and variants.
Expand All @@ -90,7 +95,7 @@ images[1]
- ControlNet "lineart_anime" task accessible and able to load a model different from the "lineart" task.
- ControlNet Tile and Recolor for SD1.5 and SDXL ("tile" replaces the previous task called "sdxl_tile_realistic").

🔥 Version 0.4.0: New Update Details
🔥 Version 0.4.0:

- IP Adapter with the variants FaceID and Instant-Style
- New samplers
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "stablepy"
version = "0.5.0"
version = "0.5.1"
description = "A tool for easy use of stable diffusion"
authors = ["Roger Condori(R3gm) <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion stablepy/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.0"
__version__ = "0.5.1"
131 changes: 109 additions & 22 deletions stablepy_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
"colab_type": "text",
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/R3gm/stablepy/blob/main/stablepy_demo.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
Expand Down Expand Up @@ -36,7 +36,7 @@
},
"outputs": [],
"source": [
"!pip install stablepy==0.5.0 -q"
"!pip install stablepy==0.5.1 -q"
]
},
{
Expand Down Expand Up @@ -309,26 +309,26 @@
},
{
"cell_type": "markdown",
"metadata": {
"id": "V0-kKkqzbLwa"
},
"source": [
"The upscaler_model_path can be used with different ESRGAN models and can also be used with Lanczos, Nearest, or the variants of latent upscaler.\n",
"Example: `upscaler_model_path=\"Latent (bicubic)\",`"
],
"metadata": {
"id": "V0-kKkqzbLwa"
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Pc6cjdVfeOWM"
},
"outputs": [],
"source": [
"from stablepy import LATENT_UPSCALERS\n",
"\n",
"list(LATENT_UPSCALERS)"
],
"metadata": {
"id": "Pc6cjdVfeOWM"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -438,8 +438,8 @@
"|canny|\"None\" \"Canny\"|\n",
"|mlsd|\"None\" \"MLSD\"|\n",
"| openpose | \"None\" \"Openpose\" |\n",
"|scribble|\"None\" \"HED\" \"Pidinet\"|\n",
"|softedge|\"None\" \"HED\" \"Pidinet\" \"HED safe\" \"Pidinet safe\"|\n",
"|scribble|\"None\" \"HED\" \"PidiNet\"|\n",
"|softedge|\"None\" \"HED\" \"PidiNet\" \"HED safe\" \"PidiNet safe\"|\n",
"|segmentation|\"None\" \"UPerNet\"|\n",
"|depth|\"None\" \"DPT\" \"Midas\"|\n",
"|normalbae|\"None\" \"NormalBae\"|\n",
Expand Down Expand Up @@ -1062,6 +1062,9 @@
},
{
"cell_type": "markdown",
"metadata": {
"id": "bF-15bKGT9W6"
},
"source": [
"- You can also use multiple images with a single IP adapter as follows by placing them in a list:\n",
"\n",
Expand All @@ -1073,10 +1076,7 @@
" ip_adapter_mode = [\"original\"],\n",
"```\n",
"\n"
],
"metadata": {
"id": "bF-15bKGT9W6"
}
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -1201,6 +1201,7 @@
"model.load_pipe(\n",
" base_model_id = repo,\n",
" task_name = \"pattern\",\n",
" retain_task_model_in_cache=False,\n",
")\n",
"\n",
"images, image_list = model(\n",
Expand All @@ -1215,6 +1216,92 @@
" display(image)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Displaying preview images during generation steps"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"model.load_pipe(\n",
" base_model_id = repo,\n",
" task_name = \"txt2img\",\n",
" retain_task_model_in_cache=False,\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"By setting `image_previews=True`, an iterable generator object for image previews will be created."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"stream = model(\n",
" prompt = \"a cat\",\n",
" negative_prompt = \"worst quality\",\n",
" sampler=\"DPM++ 2M SDE Lu\",\n",
" img_width = 768,\n",
" img_height = 768,\n",
" image_previews=True,\n",
")\n",
"\n",
"# Iterate over the generator object to get each value\n",
"for img, info_img in stream:\n",
" display(img[0])\n",
" if info_img[1]:\n",
" print(info_img)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Config the stream parameters\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"model.stream_config(\n",
" concurrency=2,\n",
" latent_resize_by=1,\n",
" vae_decoding=False,\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- **concurrency**: `int`\n",
" - **Default**: 5\n",
" - **Description**: Controls how often the preview images are generated and displayed in relation to the steps. For example, a value of 2 displays an image every 2 steps.\n",
"\n",
"- **latent_resize_by**: `int`\n",
" - **Default**: 8\n",
" - **Description**: Controls the scaling size of the latent images. A value of 1 is useful for achieving high performance.\n",
"\n",
"- **vae_decoding**: `bool`\n",
" - **Default**: `False`\n",
" - **Description**: Use the VAE to decode the preview images. If set to `True`, it may negatively impact performance."
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -1279,8 +1366,8 @@
"accelerator": "GPU",
"colab": {
"gpuType": "T4",
"provenance": [],
"include_colab_link": true
"include_colab_link": true,
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
Expand All @@ -1292,4 +1379,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}

0 comments on commit d994479

Please sign in to comment.