{"slug": "linux-desktop-image-editor-with-local-ai", "title": "Linux desktop image editor with local AI", "summary": "Inpaint, an open-source Linux desktop image editor, offers local AI-powered object removal, face replacement, restoration, upscaling, and background tools, processing images entirely on-device with network use only for dependency installation and model weight downloads. The application supports PNG, JPEG, and WebP files, includes five inpainting models, GFPGAN face restoration, HAT/RealESRGAN upscaling, and a persistent worker that keeps models loaded between edits, but warns that saving overwrites originals without creating backups.", "body_md": "A Linux desktop image editor with local AI object removal, face replacement, restoration, upscaling, and background tools. Open a folder, double-click an image, and combine edits without reloading models between operations.\n\nInpaint supports PNG, JPEG, and WebP files. Processing stays on your computer; the application only uses the network to install dependencies and download model weights.\n\nWarning\n\nSaving overwrites the original image. The application does not create a backup, so keep a copy of anything you cannot replace.\n\n- Folder tree and a responsive thumbnail gallery for large photo collections.\n- Mask painting with adjustable brush size, zoom, and pan.\n- Five selectable inpainting models for different kinds of repair.\n- GFPGAN face restoration, HAT/RealESRGAN upscaling, Lanczos resizing, and background removal tools.\n- Restormer detail restoration for defocus blur, motion blur, and noise without upscaling.\n- Face replacement using a selected source photo, with a persistent InsightFace/INSwapper model.\n- Smart selection, clone/healing brushes, live color adjustments, crop/straighten, and canvas outpainting.\n- Background replacement with a color, another image, or a blurred background, plus cutout edge refinement.\n- Horizontal/vertical image flips and 90° left/right rotations from the top toolbar, with undo/redo.\n- Model weights stored together in the app's data directory.\n- A persistent worker that keeps all used models loaded between edits and tool switches.\n- Reusable workflows, batch queues, export copies, and a visual edit history.\n\nScreenshots of the desktop application. Click any image to view it at full\nsize. Demo photo credits and capture notes are in\n[docs/screenshots](/cthackers/inpaint/blob/main/docs/screenshots/README.md).\n\nPaint over the unwanted object, then press **Space**. This example removes the\nspoon with LaMa while keeping the image at 600 × 400 pixels.\n\nYou can also hold Shift and draw and the removal will happen as soon as you release the mouse.\n\n| Paint the mask | Apply inpainting | \n|---|---|\n\nSelect a source photo and press **Replace**. The selected face is replaced and\nrestored with GFPGAN. This is an **altered demonstration image**, combining\nNASA portraits of Neil Armstrong and Eileen Collins.\n\nReal-HAT enlarges this image from 451 × 300 to 902 × 600 pixels. The comparison slider shows the previous image on the left and the edited image on the right, aligned to the same frame.\n\n| Upscale controls and result | Before/after slider | \n|---|---|\n\nGFPGAN restores faces; Restormer offers separate models for defocus blur, motion blur, and noise. These captures show GFPGAN followed by Restormer's defocus model, with the portrait remaining 512 × 512 pixels.\n\n| GFPGAN | Restormer | \n|---|---|\n\nRemove the background to transparency, refine the cutout edges, and choose a replacement. Shown here: a BRIA RMBG 1.4 cutout with its edge controls, followed by a solid white background.\n\n| Transparent cutout and edge controls | Replace the background | \n|---|---|\n\nPreview exposure, contrast, temperature, saturation, shadows, and highlights. Choose a crop ratio and straighten the image, or configure extra canvas space for outpainting. Flip and rotation controls sit in the top toolbar.\n\n| Live color preview | Square crop preview | \n|---|---|\n\nBuild a sequence from the current tool settings, save it as a workflow, and queue multiple pictures. Export settings control format, quality, filename suffix, and output dimensions. The batch capture shows two queued demo images.\n\n| Build a workflow | Queue pictures | \n|---|---|\n\nReturn to a previous edit using its thumbnail. Used models stay loaded across operations; the memory panel lists them and offers manual unloading.\n\n| Visual history | Loaded models | \n|---|---|\n\nBrowse a folder's thumbnails and double-click to edit. The **?** overlay lists\nnavigation, painting, and action shortcuts; tool buttons also show their keys.\n\n| Image gallery | Shortcut overlay | \n|---|---|\n\nThe application currently supports Linux only.\n\n`./build-portable.sh` (or `./build.sh --portable`) builds the desktop executable\nand `inpaint-desktop.AppImage` at the project root. Use the AppImage for deployment:\nit packages the Linux desktop libraries; the plain executable still needs those\nlibraries installed on the destination machine. This is an x86-64 Linux build;\nthe destination must meet the build system's glibc and graphics-driver requirements.\nBuilding on an older supported Linux distribution gives wider compatibility.\n\nOn a fresh machine, the setup screen installs a private Python 3.11 runtime and dependencies using the embedded uv installer. Choose NVIDIA/CUDA or CPU. Setup shows progress and logs and can be retried after a failed download. The first installation requires internet and several gigabytes of free disk space.\n\nInstalled runtime data goes into `$XDG_DATA_HOME/inpaint-desktop` (normally\n`~/.local/share/inpaint-desktop`). The regular executable continues to use an\nadjacent `.venv/` or `models/` directory when present. `INPAINT_PROJECT_DIR` can\noverride the data location.\n\nModel weights download on first use, including the face-swap models and MobileSAM. Downloads show progress and reuse weights already on disk. Some Hugging Face models require approval from their publisher before downloading.\n\nIf the destination lacks FUSE, run the AppImage with `--appimage-extract-and-run`.\nGPU drivers remain a host requirement and are not bundled.\n\nAn NVIDIA CUDA GPU is strongly recommended. The setup script installs the CUDA 12.8 PyTorch wheels, so a recent compatible NVIDIA driver is required. A separate system CUDA Toolkit installation is normally not necessary. The models can fall back to the CPU, but most of them will be impractically slow.\n\nGPU memory requirements vary by model and image. LaMa, MAT, ZITS, and MIGAN are the lighter choices. SDXL is substantially larger and benefits from a GPU with generous VRAM.\n\nInstall the following tools before building:\n\n- Git\n- Node.js 20 or newer and npm\n- Rust stable and Cargo (installation through [rustup](https://rustup.rs/) is recommended)\n- Python 3.11 with virtual-environment support\n- Tauri's Linux/WebKitGTK development libraries\n- A recent NVIDIA driver for GPU inference\n- ImageMagick, recommended for fast gallery thumbnails\n\n```\nsudo dnf group install \"C Development Tools and Libraries\"\nsudo dnf install \\\n  webkit2gtk4.1-devel libsoup3-devel openssl-devel libappindicator-gtk3-devel \\\n  librsvg2-devel python3.11 python3.11-devel nodejs npm git curl wget file ImageMagick\n```\n\nInstall Rust if it is not already available:\n\n```\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nsudo apt update\nsudo apt install \\\n  build-essential libwebkit2gtk-4.1-dev libssl-dev \\\n  libsoup-3.0-dev libayatana-appindicator3-dev librsvg2-dev python3 python3-venv \\\n  python3-dev git curl wget file imagemagick\n```\n\nInstall Node.js 20+ using your preferred Node.js package source, then install\nRust with [rustup](https://rustup.rs/). Distribution repositories sometimes\nprovide versions of Node.js or Rust that are too old for current Tauri tooling.\n\nFor other distributions, follow the\n[Tauri 2 Linux prerequisites](https://v2.tauri.app/start/prerequisites/).\n\nClone the repository and enter it:\n\n```\ngit clone YOUR_REPOSITORY_URL\ncd inpaint\n```\n\nInstall the frontend and model runtime dependencies:\n\n```\nnpm install\n./scripts/setup-model.sh\n```\n\nThe model setup script creates `.venv/` inside the project and installs CUDA\nPyTorch, `simple-lama-inpainting`, and IOPaint. It prints whether PyTorch can\nsee CUDA and the detected GPU. If it reports `CUDA available: False`, verify\nthe NVIDIA driver before continuing.\n\nStart the desktop application:\n\n```\nnpm run desktop\n```\n\nThe first Rust build takes longer than later launches. Model weights are not\ndownloaded during `npm install`; each model downloads when it is selected and\nused for the first time.\n\nAll models are provided by their respective upstream projects. Their weights have separate licenses and terms; review the linked sources before redistributing them.\n\n| Model | Best for | Download source | \n|---|---|---|\n| **LaMa** | Fast general-purpose object removal, people, blemishes, and natural textures | [`big-lama.pt`](https://github.com/enesmsahin/simple-lama-inpainting/releases/download/v0.1.0/big-lama.pt) from[simple-lama-inpainting](https://github.com/enesmsahin/simple-lama-inpainting) | \n| **MAT** | Large masks, landscapes, rooms, and broader scene reconstruction | [`Places_512_FullData_G.pth`](https://github.com/Sanster/models/releases/download/add_mat/Places_512_FullData_G.pth) , distributed by IOPaint; original[MAT project](https://github.com/fenglinglwb/MAT) | \n| **ZITS** | Architecture, fences, horizons, edges, and straight structural lines | Four [ZITS checkpoints](https://github.com/Sanster/models/releases/tag/add_zits) , distributed by IOPaint; original[ZITS project](https://github.com/qianyuezqy/ZITS_inpainting) | \n| **MIGAN** | Quick small or medium repairs on uncomplicated backgrounds; internally works with 512px crops | [`migan_traced.pt`](https://github.com/Sanster/models/releases/download/migan/migan_traced.pt) , distributed by IOPaint; original[MI-GAN project](https://github.com/Picsart-AI-Research/MI-GAN) | \n| **SDXL Inpainting** | Slower, prompt-guided generation when a region needs new semantic detail | [`diffusers/stable-diffusion-xl-1.0-inpainting-0.1`](https://huggingface.co/diffusers/stable-diffusion-xl-1.0-inpainting-0.1) and the[`sdxl-vae-fp16-fix`](https://huggingface.co/madebyollin/sdxl-vae-fp16-fix) VAE from Hugging Face | \n\nLaMa is approximately 197 MB. MAT, ZITS, and MIGAN are downloaded on demand through IOPaint. SDXL is a multi-gigabyte download.\n\nModel weights and caches live under `models/` in the app's data directory.\nIn a configured source checkout, they live in the repository's `models/` directory.\n\n```\nmodels/\n├── lama/          # LaMa checkpoint\n├── torch/         # Inpainting, GFPGAN, and upscaling checkpoints\n├── huggingface/   # SDXL, BRIA, and Hugging Face cache data\n├── faceswap/      # InsightFace and INSwapper models\n├── restormer/     # Detail restoration models\n└── .runtime/      # Generated persistent-worker script\n```\n\nIn a source checkout, this directory is ignored by Git except for its README. Downloaded models can be used offline. Each model loads when first used and stays in memory across tool and image changes. Upscale factors and denoising settings reuse the same network.\n\nOpen **Workspace > Memory** to unload models you no longer need. This frees RAM\nand VRAM for other operations, especially on large images. Closing the app\nreleases all loaded models.\n\nThe editor also includes:\n\n- **Smart selection** with MobileSAM: click to include an object and Alt-click to\nexclude an area. Switch back to paint\nor erase to refine the resulting selection.\n- **Mask brushes** with size, hardness, opacity, an eraser, grow/shrink, and\nfeathering. Feathered selections blend the result into the untouched image.\n- **Clone and healing brushes** : Alt-click a source point, then paint a destination.\nHealing retains sampled texture while matching local lighting.\n- **Color and lighting** with live exposure, contrast, temperature, saturation,\nshadows, and highlights previews. Apply renders the full-resolution result.\n- **Face color matching** with adjustable strength for brightness/skin-tone\nmatching on the next replacement. It is separate from the live GFPGAN slider.\n- **Background edge refinement** with shrink/expand, softness, and color-halo\nremoval using nearby opaque foreground colors.\n- **Outpainting** with independent canvas extension on all four sides, a choice\nof the existing inpainting models, and a prompt for SDXL. Original pixels and\ntransparency stay intact inside the expanded image.\n- **Shared restoration strength** for GFPGAN and face replacement. After either\noperation, the slider blends the raw and restored result without another model\nrun. A later edit or history jump ends that live adjustment.\n- **Face selection** : detect faces, click a numbered face, then choose its source\nphoto. Different faces can have different sources; use Replace individually or\nReplace all assigned faces. Without a selection, the largest face is used.\n- **Before/after comparison** against the original or the previous history step,\nwith a draggable divider and shared zoom/pan. Different sizes fit the current frame.\n- **Crop and straighten** from the top bar, with free cropping, common aspect\nratios, and an angle preview. Drag on the image to set the crop. Rotated corners\nare transparent until cropped away.\n- **Background replacement** with a color, an image, or a blurred original. The\noptional first removal step uses the background model selected in the panel.\n\nThe top-bar History, Workflows, and Export buttons open the **Workspace** drawer:\n\n- History contains named previews for the current picture. Selecting a step restores its image and dimensions; a new edit discards subsequent steps.\n- Workflows save ordered operations with the current tool settings. Add, reorder, and remove steps, then save a named workflow. Workflows persist across restarts; referenced source photos and background images must remain at their saved paths. Reusable face swaps select the largest face in each image.\n- Batch accepts multiple pictures and applies a saved workflow sequentially, reusing loaded models. Each file has progress and error reporting. Stop takes effect after the current operation; completed exports remain available. Batch reads pictures from disk, independently of unsaved editor changes.\n- Export writes PNG, JPEG, or WebP copies with format quality, dimensions, aspect ratio controls, filename suffix, and a JPEG transparency fill color. Zero in both dimensions keeps the edited size. Files are never overwritten: collisions receive numbered names. The original Save button still saves over the source.\n- Memory lists cached models and worker RAM, with individual and all-model unload controls. GPU figures cover PyTorch allocations, not ONNX/driver allocations.\n\nThe left panel also provides:\n\n- **GFPGAN 1.4** for restoring facial detail.\n- **Face swap** with automatic GFPGAN restoration of the replaced face.\n- **RealESRGAN** with photo, anime, and general-purpose models at 2× to 4× output scale.\n- **Real-HAT Sharper** for sharper AI upscaling, and**Lanczos** for standard resizing without AI reconstruction.\n- **Background removal** with BRIA RMBG 1.4/2.0 and U²-Net general/human models.\n\nBRIA 1.4 works without a login. To use BRIA 2.0, open **Set up model access**\nbelow its dropdown, request access on Hugging Face, and save a read token from\nthe approved account. You can change or remove the token using the links below\nthe dropdown. The token is stored locally with access limited to your Linux user.\n\nUse PNG or WebP to keep a transparent background. JPEG does not support transparency.\n\nThe Upscale menu offers 2×, 3×, and 4× output for every method. **General v3**\nalso has a **Denoising** slider: 0% uses the weak-denoising model to retain more\ntexture/noise; 100% uses the strong-denoising model. The initial setting is 25%.\n\nHAT uses the official `Real_HAT_GAN_sharper.pth` checkpoint from\n[XPixelGroup/HAT](https://github.com/XPixelGroup/HAT), loaded through Spandrel.\nIt processes the image in tiles to limit GPU memory use. Its native 4× output\nis resized with Lanczos when 2× or 3× is selected. HAT is slower than RealESRGAN\nand can change textures. Choose Lanczos for ordinary resizing without AI.\n\nThe HAT checkpoint (about 170 MB) and General v3 weak-denoising checkpoint\n(about 4.9 MB) download into `models/torch/hub/checkpoints/` on first use.\n`scripts/setup-model.sh` installs the required `spandrel` and `gdown` packages.\nTo install those dependencies separately:\n\n```\n.venv/bin/python -m pip install spandrel==0.4.2 gdown==5.2.0\n```\n\n**Restore detail · Restormer** (or **Alt+T**) restores the current image at its\nexisting resolution. Choose **Out-of-focus blur**, **Motion blur**, or **Photo\nnoise** to match the problem. Strength blends the restored result with the\noriginal and applies on the next run. Image dimensions and transparency are preserved.\n\nThe [official Restormer models](https://github.com/swz30/Restormer/releases/tag/v1.0)\nare about 100 MiB each and download on first use into `models/restormer/`.\nRestormer processes overlapping tiles to limit GPU memory use. If it runs out\nof GPU memory, it tries smaller tiles, then falls back to the CPU. CPU processing\nis slower. The maximum input size is 64 megapixels, and severe blur may remain\nafter restoration.\n\nRestormer is included in the app's runtime, with its upstream MIT license.\n\nIn the left panel, click the square **Select photo** picker, choose a PNG, JPEG,\nor WebP containing the face to use, then click **Replace**. The tool uses the\nlargest face in the source photo. In the target image, it replaces the face\nyou selected, or the largest face if none is selected, then restores that area\nwith GFPGAN. Replacement and restoration form one undoable edit and keep the\nimage's dimensions and transparency. If no face is detected, choose a clearer photo.\n\nThe first-launch installer and main setup script include face replacement. To reinstall its dependencies in a source checkout:\n\n```\n./scripts/setup-face-swap.sh\n```\n\nThe script installs InsightFace 0.7.3 and the CUDA-capable ONNX runtime, which\nalso supports CPU fallback. Model weights go in `models/faceswap/` and download\non first use. To copy weights from an existing installation, set\n`FACE_SWAP_PROJECT_DIR` to a directory containing `models/inswapper_128.onnx`\nand `INSIGHTFACE_MODELS_DIR` to the directory containing the `buffalo_l` models\nbefore running the script.\n\nFace replacement uses [InsightFace's INSwapper](https://github.com/deepinsight/insightface/tree/master/examples/in_swapper).\nModel weights have their own upstream license terms.\n\nHover over the `?` button in the lower-left corner of the editor to see these\ncontrols in the application.\n\n| Input | Action | \n|---|---|\n| Left mouse drag | Paint the mask | \n| Mouse wheel | Zoom around the pointer | \n| Ctrl + mouse wheel | Change brush size | \n| Space + drag or middle mouse drag | Pan | \n| Shift + paint | Apply the mask when the stroke ends | \n| Space | Apply the current mask | \n| Ctrl+Z / Ctrl+Shift+Z | Undo / redo | \n| Left / Right or A / D | Previous / next image | \n| Home / End | First / last image in the folder | \n| Numpad `*` / Numpad`/` | Fit to window / actual size | \n| Numpad `+` / Numpad`-` | Zoom in / out | \n| Ctrl+S | Overwrite the current image | \n| O | Toggle between the original and edited image | \n| Esc | Return to the folder browser | \n| Alt+T | Restore detail with the selected Restormer model and strength | \n| Alt+U | Upscale using the selected method, scale, and denoising | \n| Alt+F | Restore faces with GFPGAN and the shared strength | \n| Alt+R | Replace the selected/largest face with the selected source | \n| Alt+B | Remove the background using the selected model | \n| Alt+G | Apply the replacement background settings | \n| Alt+D | Detect faces for selection | \n| Alt+E | Apply background edge refinement | \n| Alt+C | Toggle crop and straighten | \n| Alt+H / Alt+V | Flip horizontally / vertically | \n| Alt+[ / Alt+] | Rotate left / right | \n\nAction shortcuts also appear on tool buttons and in the scrollable help overlay. They use the current tool settings, including when the tool's section is collapsed. Shortcuts are disabled while typing or running an operation.\n\nEvery tool section has an icon and a collapsible heading. Expanded states, brush settings, model choices, prompts, color/edge/outpaint settings, background choices, and workspace/export selections persist between pictures and application restarts. The last face source is remembered as a single file path and reloaded when available. Masks, detected face coordinates, crop rectangles, and image edit history belong to the current image and are cleared when you leave it.\n\nBuild and run the desktop executable:\n\n```\n./build.sh\n./inpaint-desktop\n```\n\n`build.sh` builds the frontend and optimized desktop application, verifies\nthat the executable can read its embedded `index.html` and referenced scripts\nand styles, then copies it to `inpaint-desktop` in the project root, replacing\nan existing copy. It can be invoked from any working directory. If the build\nor asset check fails, the existing root executable is preserved. Restart a\nrunning app to use the update.\n\nThe frontend is embedded; `dist/` is not needed beside the executable at runtime.\nTo check the embedded assets without opening a window, run:\n\n```\n./inpaint-desktop --check-assets\n```\n\nThe executable embeds the Rust backend and web frontend. It still needs the\nhost's Linux desktop libraries. In a configured source checkout, it reuses\nthe adjacent `.venv/` and `models/`. On a fresh machine, the setup screen\ninstalls the Python runtime as described under [Portable deployment](#portable-deployment).\n\nBuild an AppImage with the desktop libraries included:\n\n```\n./build-portable.sh\n./inpaint-desktop.AppImage\n```\n\nThe script builds the app and copies the AppImage to the project root. Tauri's\npackage output also remains under `src-tauri/target/release/bundle/appimage/`.\nDistribute `inpaint-desktop.AppImage`; Python dependencies install during setup,\nand model weights download when first used. They are stored outside the AppImage.\n\nCreate a distribution package only if system installation is desired:\n\n```\n# Debian and Ubuntu\nnpm run tauri -- build --bundles deb\n\n# Fedora and other RPM-based distributions\nnpm run tauri -- build --bundles rpm\n```\n\nDEB and RPM packages install the binary, desktop entry, and icons into system\nlocations such as `/usr/bin` and `/usr/share`. The first-launch setup installs\nthe Python runtime in the user's app data directory. Model weights download\non first use. Set `INPAINT_PROJECT_DIR` to reuse a prepared runtime directory.\n\nTo build all package formats configured in `src-tauri/tauri.conf.json`, run:\n\n```\nnpm run tauri -- build\n```\n\nAll package output is written below `src-tauri/target/release/bundle/`.\nPackage compatibility varies by Linux distribution.\n\nInpaint is licensed under the [GNU Affero General Public License, version 3](/cthackers/inpaint/blob/main/LICENSE)\n(`AGPL-3.0-only`). Copyright (c) 2026 Inpaint contributors.\n\nThe face-swap integration was adapted from a local project based on\n[Deep-Live-Cam](https://github.com/hacksider/Deep-Live-Cam). Its upstream credits\nand license are recorded in the\n[code provenance notes](/cthackers/inpaint/blob/main/THIRD_PARTY_NOTICES.md#face-swap-code-provenance).\n\nWhen publishing executables or AppImages, provide the corresponding source for\nthat exact release, including build scripts, alongside the download. Include\n`LICENSE` and `THIRD_PARTY_NOTICES.md` with the release and retain upstream notices.\nModified versions offered for remote use over a network must also offer their\ncorresponding source to those users, as required by section 13 of the license.\nInpaint is provided without warranty; see `LICENSE` for the full terms.\n\nLibraries, model weights, and screenshot photos retain their upstream licenses.\nSome models are restricted to non-commercial use or research. See\n[Third-party software and models](/cthackers/inpaint/blob/main/THIRD_PARTY_NOTICES.md) for the license notes\nand links to their terms.\n\n- [Tauri 2](https://tauri.app/) and Rust\n- React, TypeScript, and Vite\n- PyTorch with CUDA\n- [IOPaint](https://github.com/Sanster/IOPaint)\n- [simple-lama-inpainting](https://github.com/enesmsahin/simple-lama-inpainting)", "url": "https://wpnews.pro/news/linux-desktop-image-editor-with-local-ai", "canonical_source": "https://github.com/cthackers/inpaint", "published_at": "2026-09-08 23:29:28+00:00", "updated_at": "2026-09-08 23:48:17.994086+00:00", "lang": "en", "topics": ["ai-tools", "computer-vision", "generative-ai"], "entities": ["Inpaint", "GFPGAN", "HAT", "RealESRGAN", "Restormer", "BRIA RMBG 1.4", "InsightFace/INSwapper", "LaMa"], "alternates": {"html": "https://wpnews.pro/news/linux-desktop-image-editor-with-local-ai", "markdown": "https://wpnews.pro/news/linux-desktop-image-editor-with-local-ai.md", "text": "https://wpnews.pro/news/linux-desktop-image-editor-with-local-ai.txt", "jsonld": "https://wpnews.pro/news/linux-desktop-image-editor-with-local-ai.jsonld"}}