Skip to main content

Node-based image processing powered by CUDA - Design visually, execute programmatically

Project description

PyImageCUDA Studio 0.1.3 Beta

PyPI version Version Python CUDA License Platform

Design image pipelines visually. Automate with Python.

Node-based GPU compositor with real-time preview and headless batch processing.

Core is PyImageCUDA, my custom CUDA library with native kernels for all operations.

Dependencies only for UI (PySide6), I/O (PyVips), and preview (PyOpenGL), no CUDA Toolkit required (just NVIDIA drivers).

https://github.com/user-attachments/assets/6a0ab3da-d961-4587-a67c-7d290a008017

https://github.com/user-attachments/assets/f5c6a81d-5741-40e0-ad55-86a171a8aaa4


Key Features

Visual Node Editor

  • 40+ GPU-accelerated nodes: Generators, effects, filters, transforms, blend modes (see full list below)
  • Real-time preview: CUDA-OpenGL interop for instant visual feedback on every change
  • Global variables: Link any parameter across multiple nodes for template reuse
  • Flexible controls: Numeric inputs with optional sliders for precise adjustments
  • Intuitive workflow: Right-click to add nodes, drag to connect, see results instantly

Headless Automation

  • Simple Python API: Load .pics projects and modify parameters programmatically
  • Batch processing: Generate thousands of variations in seconds
  • Type-safe validation: All parameters validated (colors, sizes, text, ranges, etc.)
from pyimagecuda_studio import LoadProject, run, set_node_parameter

with LoadProject("sign.pics"):
    for i in range(1, 11):
        set_node_parameter("Text", "text", f"Test {i}")
        run(f"output_{i:02d}.png")

Performance

  • 10-350x faster: than CPU alternatives for complex operations, see PyImageCUDA benchmarks
  • 5-15ms rendering — Typical 1080p pipelines (RTX 3070, varies by GPU)
  • Memory efficient: GPU buffers created on-demand and reused intelligently

Installation

Requirements

  • Python 3.10+
  • NVIDIA GPU (GTX 900 series or newer)
  • OS: Windows 10/11 or Linux

Install via pip

pip install pyimagecuda-studio

Launch GUI

pyimagecuda-studio
# or shorter alias:
pics

Available Nodes

Generators (13 nodes)

  • Image — Load from file with resize options
  • Text — Rich text rendering (font, size, color, alignment, spacing)
  • Dynamic Text — Python-generated text (API calls, calculations, etc.)
  • Color — Solid fill
  • Gradient — Linear/radial/diagonal gradients
  • Stripes — Angled stripe patterns
  • Checkerboard — Classic checker pattern
  • Grid — Customizable grid lines
  • Dots — Polka dot patterns
  • Circle — Perfect circle
  • Ngon — Regular polygons (3-20 sides)
  • Noise — White noise (RGB or monochrome)
  • Perlin — Organic noise textures

Effects (4 nodes)

  • Rounded Corners — Smooth corner radius
  • Drop Shadow — Blur, offset, color control
  • Stroke — Inside/outside outline
  • Vignette — Edge darkening

Filters (8 nodes)

  • Gaussian Blur — Fast separable blur
  • Sharpen — Unsharp mask
  • Sepia — Vintage tone
  • Invert — Color negative
  • Threshold — Binary conversion
  • Solarize — Partial inversion
  • Sobel — Edge detection
  • Emboss — 3D relief

Adjust (5 nodes)

  • Brightness — Linear adjustment
  • Contrast — Midpoint scaling
  • Saturation — Color intensity
  • Gamma — Non-linear correction
  • Opacity — Alpha blending

Transform (6 nodes)

  • Resize — Scale to exact dimensions (Nearest/Bilinear/Bicubic/Lanczos)
  • Aspect Resize — Maintain ratio while resizing
  • Scale — Percentage-based scaling
  • Flip — Horizontal/vertical/both
  • Rotate — Arbitrary angles with optional expand
  • Crop — Extract rectangular region
  • Zoom — Zoom in/out with offset

Merge (2 nodes)

  • Blend — Composite two images with Photoshop-style blend modes
    • Modes: Normal, Multiply, Screen, Add, Overlay, Soft Light, Hard Light
    • Positioning: 9 anchor points (top-left, center, bottom-right, etc.) + pixel offset
    • Control: Opacity slider (0.0-1.0)
  • Mask — Use image brightness or alpha as transparency mask
    • Modes: Luminance (brightness) or Alpha channel
    • Positioning: Same anchor + offset system as Blend

Logic (2 nodes)

  • Random Out — Randomly select between inputs
  • Conditional — Python-based routing logic

Utility (1 node)

  • Split — Duplicate to 2 outputs

Headless Mode

Design templates in the GUI, automate generation with Python.

Basic Example

from pyimagecuda_studio import LoadProject, set_node_parameter, run

with LoadProject("template.pics"):
    set_node_parameter("Text", "text", "Hello World")
    run("output.png")

Batch Processing

from pyimagecuda_studio import LoadProject, set_node_parameter, run

with LoadProject("certificate.pics"):
    for name in ["Alice", "Bob", "Charlie"]:
        set_node_parameter("Text", "text", f"Certificate for {name}")
        run(f"certs/{name}.png")

Global Variables

Control multiple parameters at once:

from pyimagecuda_studio import LoadProject, set_variable, run

with LoadProject("banner.pics"):
    set_variable("primary_color", (0.2, 0.4, 0.8, 1.0))
    set_variable("title", "Summer Sale")
    run("output.png")

Real-World: CSV Data

import csv
from pyimagecuda_studio import LoadProject, set_variable, run

with LoadProject("product_card.pics"):
    with open('products.csv') as f:
        for row in csv.DictReader(f):
            set_variable("product_name", row['name'])
            set_variable("price", f"${row['price']}")
            set_node_parameter("Image", "path", row['image_path'])
            run(f"cards/{row['id']}.png")

API Functions

# Load project (context manager handles cleanup)
with LoadProject(filepath, trust_code=False):
    
    # Modify nodes directly
    set_node_parameter(node_name, param_name, value)
    
    # Modify global variables
    set_variable(name, value)
    
    # Generate output
    run(output_path, quality=None)
    
    # Query project
    get_nodes()           # -> list[str]
    get_variables()       # -> list[str]
    get_node_parameters(node_name)  # -> dict

Security Note

Projects with Dynamic Text or Conditional nodes execute Python code. Set trust_code=True only for projects you trust:

with LoadProject("untrusted.pics", trust_code=True):  # ⚠️ Only if you trust the source
    run("output.png")

Roadmap to v1.0

Current: v0.1.0 Beta

Core functionality complete and stable.

Path to v1.0 Stable

  • Bug fixes — Address issues reported by community
  • Undo/redo — Full history system for GUI operations
  • Memory pooling — Intelligent VRAM reuse to reduce memory footprint
  • Expanded library — More nodes, effects, and generators

Timeline: v1.0 release when all critical features are stable and well-tested.


Contributing

Beta Release — Contributions, feedback, and collaborators welcome!

I'm very open to:

  • Code contributions — Pull requests for bug fixes, features, or optimizations
  • Ideas and suggestions — Feature requests and use case proposals
  • Use case adaptations — I'm happy to adapt the program for personal workflows if they have general applicability

All contributions, questions, and feature requests go through GitHub Issues.

I'll respond as quickly as I can.

When reporting bugs, include:

  • OS and GPU model
  • Python version
  • Error message or unexpected behavior
  • .pics project file (if applicable)

License

MIT License

Copyright (c) 2025 Beltrán Offerrall Selma

See LICENSE file for details.


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

pyimagecuda_studio-0.1.3.tar.gz (63.8 kB view details)

Uploaded Source

Built Distribution

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

pyimagecuda_studio-0.1.3-py3-none-any.whl (79.7 kB view details)

Uploaded Python 3

File details

Details for the file pyimagecuda_studio-0.1.3.tar.gz.

File metadata

  • Download URL: pyimagecuda_studio-0.1.3.tar.gz
  • Upload date:
  • Size: 63.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pyimagecuda_studio-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4ae611072f3920315b10ffa7cf3f344bc37af11c375538324e8945769bb68cc5
MD5 ab52c8b4739abb199437b799336a6dc7
BLAKE2b-256 03648b61c01165df6dd36c91814ab370d6eff0b218316e3d1b94c2a304f819cd

See more details on using hashes here.

File details

Details for the file pyimagecuda_studio-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pyimagecuda_studio-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8692691cd5bc10a26110eedcc020ffc51ecdf19038317269428e0e71cfd587ce
MD5 159849aefd19549523e27780635b02b8
BLAKE2b-256 536d2e87a0bddd604fa831d5292103b991d44709a2cf8eef61abdd0134e55d5d

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