902 字
5 分钟

ImageFlow: An Image Host That Actually Fits Your Workflow

I’ve been using chevereto as my image host for a long time, but the author has taken it in a direction I really can’t stand. The project keeps getting bloated with pointless social features, which makes it heavier and slower. As for other projects on the market, most of them are designed for multi-user scenarios, which is the opposite of what I want, so I wasn’t interested in trying more.

Since nothing really fit my needs, I decided to build my own and add features I actually care about, such as automatic compression to AVIF and WebP, and an API that can adapt image orientation (landscape/portrait) automatically. That’s how ImageFlow was born.

Repo: https://github.com/Yuri-NagaSaki/ImageFlow/ — feel free to drop a star.

✨ Main Features#

  • API key authentication: secure API key-based auth to protect your upload endpoint

  • Adaptive image service: automatically serves landscape or portrait images based on device type (desktop/mobile)

  • Modern format support: detects browser capabilities and serves images in WebP or AVIF

  • Simple API: fetch random images through a straightforward API call

  • User-friendly upload UI: drag-and-drop upload, dark mode, and real-time preview

  • Image management: intuitive dashboard to view, filter, and delete images

  • Automatic image processing: automatically detects orientation on upload and converts to multiple formats

  • Multiple storage backends: supports local storage as well as S3-compatible storage

🚀 Technical Advantages#

  1. Security: API key verification ensures secure access to upload and management features

  2. Format conversion: automatically converts uploaded images to WebP and AVIF, reducing file size by 30–50%

  3. Device adaptation: serves the most suitable orientation for different devices

  4. Hot reload: newly uploaded images are immediately available without restarting the service

  5. Concurrent processing: leverages Go’s concurrency for efficient image conversion

  6. Extensibility: modular design makes it easy to extend and customize

  7. Responsive UI: works seamlessly on both desktop and mobile devices

  8. Dark mode support: automatically follows the system theme

  9. Flexible storage: supports both local and S3-compatible storage, easily configured via the .env file

📸 UI Preview#

ImageFlow ImageFlow ImageFlow ImageFlow

Quick Start#

You can pick one of two equally convenient deployment options: Docker, or running the binary directly.

Let’s start with the easiest: Docker.

Docker Deployment#

Clone the repo and cd into it:

Terminal window
git clone https://github.com/Yuri-NagaSaki/ImageFlow && cd ImageFlow
Git clone command output shown in a terminal

Edit the .env file:

Terminal window
cp .env.example .env
vim .env

Adjust the parameters based on the deployment mode you choose. As for how to obtain the S3-related parameters below, I won’t go into detail here.

Terminal window
# API Keys
API_KEY=your_api_key_here # This is your API key used for authenticated login
# Storage Configuration
STORAGE_TYPE=local # Options: local, s3 Choose according to your deployment mode
LOCAL_STORAGE_PATH=static/images # Local
# S3 Configuration (required when STORAGE_TYPE=s3)
S3_ENDPOINT=
S3_REGION=
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_BUCKET=
# Custom Domain (optional)
CUSTOM_DOMAIN= # Custom domain usually provided when using S3.

Pull the image and start the service:

Terminal window
docker compose up -d
一般默认监听8686端口,如有必要,自行修改。
Docker terminal showing docker compose and ps command output

Local Deployment#

Install dependencies#

Install Go (1.22+)

Install WebP tools: sudo apt-get install webp (Ubuntu/Debian)

Install AVIF tools: sudo apt-get install libavif-bin (Ubuntu)

Note: AVIF needs to be version 1.0 or higher. On Debian, the default package is 0.9, so you’ll need to build from source.

On Ubuntu 24.04 you can install the latest version directly from the repos.

Terminal showing Ubuntu version information

Download the binary and edit env

Binaries are provided for both x86 and ARM — pick the one you need.

Terminal window
git clone https://github.com/Yuri-NagaSaki/ImageFlow && cd ImageFlow
https://github.com/Yuri-NagaSaki/ImageFlow/releases/download/v1.0/imageflow-x86
chmod 777 imageflow-x86
cp .env.example .env
vim .env
./imageflow-x86
Terminal showing file operations and server startup

Create a systemd service:

Terminal window
[Unit]
Description=ImageFlow Service
After=network.target
[Service]
ExecStart=/path/to/imageflow
WorkingDirectory=/path/to/imageflow/directory
Restart=always
User=youruser
[Install]
WantedBy=multi-user.target

How to Use#

Open IP:8686 in your browser and enter the API_KEY you set in the .env file.

Then start uploading images.

Note: since compression is performed locally, it’s best to deploy on a server with a reasonably strong CPU.

Image upload interface with drag-and-drop and file picker Anime-style illustration of two girls interacting closely

Click the top-right button to enter the management panel.

Upload tool interface supporting multiple image formats

Here you’ll see all your uploaded and compressed images.

Anime character image collection in a file management interface

You can, of course, delete any image. This will also remove the corresponding original, AVIF, and WebP files.

Blue-haired anime character in purple clothing, cartoon style

Accessing the API#

The API endpoint is: IP:8686/api/ramdom

Anime girl illustration by a window Anime girl putting on makeup, body covered in graffiti-style paint

And that’s everything — you’re good to go!

🤝 Contributing#

Contributions are welcome! Feel free to submit PRs, open issues, or suggest improvements at any time!

ImageFlow: An Image Host That Actually Fits Your Workflow
https://catcat.blog/en/imageflow-install.html
作者
猫猫博客
发布于
2025-03-22
许可协议
CC BY-NC-SA 4.0