Slojka: AI-first graphic editor with SAM 2.1 and Claude Code

Slojka is a TypeScript-based graphic editor using WebGL2 and native AI integrations for image segmentation and generation.

cpaua3 min179

HelpFreedom has released slojka, an AI-first graphic editor designed for image manipulation in a style similar to Photoshop. Built with TypeScript and WebGL2 for rendering, the tool integrates local segmentation models and AI assistants to automate complex editing tasks.

WebGL2 rendering and layer management

The editor supports raster, text, and smart layers. Smart layers allow for scaling, rotation, and movement without losing quality, ensuring that content outside the canvas boundaries is preserved.

Text tools allow for fragment-specific styling, enabling different fonts, sizes, and colors within a single text block. The system includes layer masks, clipping masks, and eight blending modes.

The toolset includes rectangle, oval, lasso, and magic wand selections, as well as selection brushes with live feathering. Layer styles provide Gaussian blur, motion blur, and outer strokes based on a Euclidean distance field.

Brushes and erasers support pen pressure and can import .abr files from Photoshop or .kpp files from Krita. The application supports its own .slojka zip format, alongside PSD and ORA imports, and exports to PNG, JPEG, WebP, and ORA.

Local and cloud AI integrations

Slojka includes a local ISNet model via ONNX Runtime for offline background removal. For precise object selection, it integrates SAM 2.1, which runs locally on CUDA or CPU without requiring an internet connection.

Integration with polza.ai enables image generation using models like Flux, Grok, and Qwen. This hub provides upscaling and object replacement tools that insert results as new layers.

A "Photobash" feature merges all visible elements into a single image and reconstructs it into a cohesive scene with unified lighting and materials. This functionality is part of a broader trend of extending AI capabilities through specialized tools.

Editor control via Claude Code

The editor features a built-in terminal with Claude Code, which manages the software through an MCP server with 27 available tools. Users can request the assistant to draw, generate, or save files using text commands.

All edits made by the AI assistant are reversible via Ctrl+Z. This implementation follows the pattern of using Claude Code for software control to streamline technical workflows.

Installation and environment setup

The software is available as an AppImage for Linux and an .exe installer for Windows, which automatically installs Python 3.11 and VC++ Redistributable if missing.

To run the project from source, Node.js version 20.19 or higher is required:

bash
git clone https://github.com/HelpFreedom/slojka.git
cd slojka
npm install
npm run dev

Local AI functions require Python 3.10 or higher. SAM 2.1 is installed via the settings menu into an isolated venv, requiring a PyTorch download of approximately 2.5 GB.

Sources

HelpFreedom/slojkagithub.com/HelpFreedom/slojka
Share

Author

cpaua

VibeCode blog admin. Writing about vibe coding, AI and open source.

Related news

Comments

To leave a comment, log in
Loading...

Weekly digest

The best of vibe coding, AI agents and open source — once a week, no spam.