Datasets:
Publish P.AI AI Image Studio Official Extensions Hub (v1.0.0 pre-release)
Browse files- README.md +40 -0
- extensions/before_after_studio_export.py +53 -0
- extensions/multi_image_studio.py +46 -0
- extensions/smart_batch_presets.py +47 -0
- manifest.json +36 -0
- previews/before_after_studio_export.png +3 -0
- previews/multi_image_studio.png +3 -0
- previews/smart_batch_presets.png +3 -0
README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
pretty_name: P.AI AI Image Studio — Official Extensions Hub
|
| 4 |
+
tags:
|
| 5 |
+
- pai-ai-image-studio
|
| 6 |
+
- image-generation
|
| 7 |
+
- image-editing
|
| 8 |
+
- extensions
|
| 9 |
+
- pyside6
|
| 10 |
+
- pytorch
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# P.AI AI Image Studio — Official Extensions Hub
|
| 14 |
+
|
| 15 |
+
> **Status: Pre-Release / Unreleased Application**
|
| 16 |
+
> This repository is the official online Extensions Hub for **P.AI AI Image Studio** (a standalone desktop PySide6 + Native PyTorch/CUDA multi-engine AI image studio supporting **Qwen-Image 2.1**, **FLUX.3 Image Klein**, and **MOSS-Image**). **P.AI AI Image Studio has not been publicly released yet**; this hub is hosted ahead of release for internal testing and in-app extension discovery.
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## Included Extensions (`v1.0.0`, MIT License)
|
| 21 |
+
|
| 22 |
+
All extensions are lightweight, readable, plain-Python (`.py`) add-ons with zero external binary dependencies.
|
| 23 |
+
|
| 24 |
+
| Extension | ID | Category | Version | Description |
|
| 25 |
+
| :--- | :--- | :--- | :---: | :--- |
|
| 26 |
+
| **Multi-Image Studio** | `multi_image_studio` | Workflow | `1.0.0` | Dedicated multi-reference board & composition workflow combining up to 4 numbered references (`1–4`). |
|
| 27 |
+
| **Before / After & Studio Logo Export** | `before_after_studio_export` | Export | `1.0.0` | Export side-by-side Before/After comparison sheets with optional studio branding logo overlay. |
|
| 28 |
+
| **Smart Batch Workflow Presets** | `smart_batch_presets` | Automation | `1.0.0` | Chain multi-step presets (e.g. `Remove BG → Smart Outpaint → Enhance`) across queued image batches. |
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## Repository Structure
|
| 33 |
+
|
| 34 |
+
- `manifest.json` — Machine-readable catalog read automatically by **P.AI AI Image Studio** when clicking **`↻ Check for Extensions`**.
|
| 35 |
+
- `extensions/` — Standalone plain-Python extension modules (`*.py`).
|
| 36 |
+
- `previews/` — High-resolution visual preview cards (`*.png`) displayed inside the in-app **P.AI Extensions** dialog before downloading.
|
| 37 |
+
|
| 38 |
+
## License
|
| 39 |
+
|
| 40 |
+
All extensions and assets in this hub are released under the **MIT License**.
|
extensions/before_after_studio_export.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""P.AI Extension: Before / After & Studio Logo Export (Plain Python, MIT License)."""
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
from typing import Optional
|
| 7 |
+
from PIL import Image, ImageDraw, ImageOps
|
| 8 |
+
|
| 9 |
+
EXTENSION_META = {
|
| 10 |
+
"id": "before_after_studio_export",
|
| 11 |
+
"name": "Before / After & Studio Logo Export",
|
| 12 |
+
"version": "1.0.0",
|
| 13 |
+
"category": "Export",
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def export_before_after_sheet(
|
| 18 |
+
before_path: str | Path,
|
| 19 |
+
after_path: str | Path,
|
| 20 |
+
output_path: str | Path,
|
| 21 |
+
*,
|
| 22 |
+
logo_path: Optional[str | Path] = None,
|
| 23 |
+
divider_px: int = 6,
|
| 24 |
+
) -> Path:
|
| 25 |
+
"""Create a side-by-side Before / After delivery image with optional studio logo overlay."""
|
| 26 |
+
with Image.open(before_path) as b_im, Image.open(after_path) as a_im:
|
| 27 |
+
after = ImageOps.exif_transpose(a_im).convert("RGB")
|
| 28 |
+
before = ImageOps.fit(ImageOps.exif_transpose(b_im).convert("RGB"), after.size, Image.Resampling.LANCZOS)
|
| 29 |
+
|
| 30 |
+
w, h = after.size
|
| 31 |
+
canvas = Image.new("RGB", (w * 2 + divider_px, h), (15, 20, 28))
|
| 32 |
+
canvas.paste(before, (0, 0))
|
| 33 |
+
canvas.paste(after, (w + divider_px, 0))
|
| 34 |
+
draw = ImageDraw.Draw(canvas)
|
| 35 |
+
draw.rectangle((w, 0, w + divider_px, h), fill=(59, 118, 246))
|
| 36 |
+
draw.rounded_rectangle((16, 16, 116, 48), radius=8, fill=(15, 20, 28))
|
| 37 |
+
draw.text((34, 26), "BEFORE", fill=(230, 238, 250))
|
| 38 |
+
draw.rounded_rectangle((w + divider_px + 16, 16, w + divider_px + 112, 48), radius=8, fill=(59, 118, 246))
|
| 39 |
+
draw.text((w + divider_px + 38, 26), "AFTER", fill=(255, 255, 255))
|
| 40 |
+
|
| 41 |
+
if logo_path and Path(logo_path).is_file():
|
| 42 |
+
with Image.open(logo_path) as lg:
|
| 43 |
+
logo = lg.convert("RGBA")
|
| 44 |
+
max_lw = max(48, w // 6)
|
| 45 |
+
logo.thumbnail((max_lw, max_lw), Image.Resampling.LANCZOS)
|
| 46 |
+
canvas_rgba = canvas.convert("RGBA")
|
| 47 |
+
canvas_rgba.alpha_composite(logo, (canvas.width - logo.width - 18, canvas.height - logo.height - 18))
|
| 48 |
+
canvas = canvas_rgba.convert("RGB")
|
| 49 |
+
|
| 50 |
+
out_p = Path(output_path)
|
| 51 |
+
out_p.parent.mkdir(parents=True, exist_ok=True)
|
| 52 |
+
canvas.save(out_p, quality=95)
|
| 53 |
+
return out_p
|
extensions/multi_image_studio.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""P.AI Extension: Multi-Image Studio (Plain Python, MIT License)."""
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
from typing import Iterable, Tuple
|
| 7 |
+
from PIL import Image, ImageDraw, ImageOps
|
| 8 |
+
|
| 9 |
+
EXTENSION_META = {
|
| 10 |
+
"id": "multi_image_studio",
|
| 11 |
+
"name": "Multi-Image Studio",
|
| 12 |
+
"version": "1.0.0",
|
| 13 |
+
"category": "Workflow",
|
| 14 |
+
"workflow_id": "multi_image_studio",
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
def build_multi_reference_board(
|
| 19 |
+
image_paths: Iterable[str | Path],
|
| 20 |
+
*,
|
| 21 |
+
tile_size: int = 512,
|
| 22 |
+
padding: int = 16,
|
| 23 |
+
bg_color: Tuple[int, int, int] = (18, 22, 30),
|
| 24 |
+
) -> Image.Image:
|
| 25 |
+
"""Combine 1-4 reference images into a clean numbered reference board (① ② ③ ④)."""
|
| 26 |
+
imgs = []
|
| 27 |
+
for p in list(image_paths)[:4]:
|
| 28 |
+
with Image.open(p) as im:
|
| 29 |
+
imgs.append(ImageOps.fit(ImageOps.exif_transpose(im).convert("RGB"), (tile_size, tile_size), Image.Resampling.LANCZOS))
|
| 30 |
+
if not imgs:
|
| 31 |
+
raise ValueError("At least one image is required.")
|
| 32 |
+
cols = min(len(imgs), 2)
|
| 33 |
+
rows = (len(imgs) + cols - 1) // cols
|
| 34 |
+
board_w = cols * tile_size + (cols + 1) * padding
|
| 35 |
+
board_h = rows * tile_size + (rows + 1) * padding
|
| 36 |
+
board = Image.new("RGB", (board_w, board_h), bg_color)
|
| 37 |
+
draw = ImageDraw.Draw(board)
|
| 38 |
+
badges = ("1", "2", "3", "4")
|
| 39 |
+
for idx, im in enumerate(imgs):
|
| 40 |
+
r, c = divmod(idx, cols)
|
| 41 |
+
x0 = padding + c * (tile_size + padding)
|
| 42 |
+
y0 = padding + r * (tile_size + padding)
|
| 43 |
+
board.paste(im, (x0, y0))
|
| 44 |
+
draw.rounded_rectangle((x0 + 10, y0 + 10, x0 + 44, y0 + 44), radius=10, fill=(59, 118, 246))
|
| 45 |
+
draw.text((x0 + 23, y0 + 20), badges[idx], fill=(255, 255, 255))
|
| 46 |
+
return board
|
extensions/smart_batch_presets.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""P.AI Extension: Smart Batch Workflow Presets (Plain Python, MIT License)."""
|
| 3 |
+
from dataclasses import dataclass
|
| 4 |
+
from typing import Any
|
| 5 |
+
|
| 6 |
+
EXTENSION_META = {
|
| 7 |
+
"id": "smart_batch_presets",
|
| 8 |
+
"name": "Smart Batch Workflow Presets",
|
| 9 |
+
"version": "1.0.0",
|
| 10 |
+
"category": "Automation",
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
@dataclass(frozen=True)
|
| 15 |
+
class BatchPipelinePreset:
|
| 16 |
+
id: str
|
| 17 |
+
title: str
|
| 18 |
+
steps: tuple[str, ...]
|
| 19 |
+
description: str
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
BUILTIN_PRESETS: tuple[BatchPipelinePreset, ...] = (
|
| 23 |
+
BatchPipelinePreset(
|
| 24 |
+
id="ecommerce_clean_pack",
|
| 25 |
+
title="E-Commerce Pack (Remove BG -> Smart Outpaint 1:1 -> Enhance)",
|
| 26 |
+
steps=("bg_remove", "square_1_1", "enhance"),
|
| 27 |
+
description="Cuts out the product background, expands to 1:1 canvas, and enhances fine surface detail.",
|
| 28 |
+
),
|
| 29 |
+
BatchPipelinePreset(
|
| 30 |
+
id="portrait_studio_pack",
|
| 31 |
+
title="Portrait Studio Pack (Smart Outpaint 4:5 -> Enhance)",
|
| 32 |
+
steps=("square_1_1", "enhance"),
|
| 33 |
+
description="Expands short sides to 4:5 portrait ratio and runs faithful photographic restoration.",
|
| 34 |
+
),
|
| 35 |
+
)
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def expand_preset_jobs(preset_id: str, input_paths: list[str]) -> list[dict[str, Any]]:
|
| 39 |
+
"""Expand a batch preset into an ordered list of workflow step descriptors for each input image."""
|
| 40 |
+
preset = next((p for p in BUILTIN_PRESETS if p.id == preset_id), None)
|
| 41 |
+
if preset is None:
|
| 42 |
+
raise KeyError(f"Unknown batch preset: {preset_id}")
|
| 43 |
+
plan: list[dict[str, Any]] = []
|
| 44 |
+
for path in input_paths:
|
| 45 |
+
for step_idx, wf in enumerate(preset.steps, start=1):
|
| 46 |
+
plan.append({"input_path": path, "step": step_idx, "workflow": wf, "preset": preset.id})
|
| 47 |
+
return plan
|
manifest.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 1,
|
| 3 |
+
"publisher": "AnosVoldigoad1",
|
| 4 |
+
"extensions": [
|
| 5 |
+
{
|
| 6 |
+
"id": "multi_image_studio",
|
| 7 |
+
"name": "Multi-Image Studio",
|
| 8 |
+
"version": "1.0.0",
|
| 9 |
+
"category": "Workflow",
|
| 10 |
+
"license": "MIT",
|
| 11 |
+
"description": "Dedicated multi-reference board & composition workflow combining up to 4 numbered references (1-4).",
|
| 12 |
+
"preview_url": "https://huggingface.co/datasets/AnosVoldigoad1/PAI-AI-Image-Studio-Extensions/resolve/main/previews/multi_image_studio.png",
|
| 13 |
+
"download_url": "https://huggingface.co/datasets/AnosVoldigoad1/PAI-AI-Image-Studio-Extensions/resolve/main/extensions/multi_image_studio.py"
|
| 14 |
+
},
|
| 15 |
+
{
|
| 16 |
+
"id": "before_after_studio_export",
|
| 17 |
+
"name": "Before / After & Studio Logo Export",
|
| 18 |
+
"version": "1.0.0",
|
| 19 |
+
"category": "Export",
|
| 20 |
+
"license": "MIT",
|
| 21 |
+
"description": "Export side-by-side Before/After comparison sheets with optional studio branding logo overlay.",
|
| 22 |
+
"preview_url": "https://huggingface.co/datasets/AnosVoldigoad1/PAI-AI-Image-Studio-Extensions/resolve/main/previews/before_after_studio_export.png",
|
| 23 |
+
"download_url": "https://huggingface.co/datasets/AnosVoldigoad1/PAI-AI-Image-Studio-Extensions/resolve/main/extensions/before_after_studio_export.py"
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"id": "smart_batch_presets",
|
| 27 |
+
"name": "Smart Batch Workflow Presets",
|
| 28 |
+
"version": "1.0.0",
|
| 29 |
+
"category": "Automation",
|
| 30 |
+
"license": "MIT",
|
| 31 |
+
"description": "Chain multi-step presets (e.g. Remove BG -> Smart Outpaint -> Enhance) across queued image batches.",
|
| 32 |
+
"preview_url": "https://huggingface.co/datasets/AnosVoldigoad1/PAI-AI-Image-Studio-Extensions/resolve/main/previews/smart_batch_presets.png",
|
| 33 |
+
"download_url": "https://huggingface.co/datasets/AnosVoldigoad1/PAI-AI-Image-Studio-Extensions/resolve/main/extensions/smart_batch_presets.py"
|
| 34 |
+
}
|
| 35 |
+
]
|
| 36 |
+
}
|
previews/before_after_studio_export.png
ADDED
|
Git LFS Details
|
previews/multi_image_studio.png
ADDED
|
Git LFS Details
|
previews/smart_batch_presets.png
ADDED
|
Git LFS Details
|