CoolFace
Apppublic

saadmalik1/Visual_Effects

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
App README

Visual-Effect-Master ๐ŸŽฌ

A high-performance, cloud-hosted Video & Image Effects API. Apply 55+ custom effects, stylish frames, and artistic filters with a single API call.

๐Ÿš€ Live API

Interactive Documentation: https://saadmalik1-visual-effects.hf.space/docs

โœจ Key Features

  • โ€”87 Custom Effects: Now with advanced Masking, Overlays, and 16+ Aesthetic Social Frames (Instagram, TikTok, Cinema IMAX).
  • โ€”Social Ready: Dedicated frames like frame_instagram, frame_story, and frame_tiktok.
  • โ€”Sequential Processing: Apply multiple effects at once (e.g., enhance_hdr, frame_instagram, overlay_film_grain).
  • โ€”High Performance: Built with FastAPI and optimized OpenCV.
  • โ€”Secure: Processing endpoints (Image/Video) are protected by API Key.
  • โ€”Public Discovery: Root (/) and Effects List (/effects) are public for easy browsing.

๐Ÿ”‘ Authentication

All requests must include the following header:

  • โ€”Header Name: X-API-Key
  • โ€”Default Key: trusted_dev_key (Contact admin for private keys)

๐Ÿ“ก API Endpoints

1. List All Effects

GET /effects - Returns a JSON list of all 56 available effect names.

2. Apply Effects (Image) ๐Ÿ–ผ๏ธ

POST /apply_effect/ - Processes an image with one or more effects.

Parameters:

  • โ€”file: (Optional) The image file (multipart/form-data).
  • โ€”image_base64: (Optional) The image as a base64 string.
  • โ€”effect_name: Comma-separated list of effects (e.g., cartoon, frame_minimalist).
[!NOTE] You must provide either file or image_base64.

3. Apply Effects (Video) ๐ŸŽฅ

POST /apply_video_effect/ - Processes a video file with audio preservation.

Parameters:

  • โ€”file: The video file (.mp4, .mov, etc.) (multipart/form-data).
  • โ€”effect_name: Comma-separated list of effects (e.g., cartoon, frame_vlog).

๐Ÿ’ป Usage Examples

๐ŸŽฅ Video Processing (Python)

python
import requests

url = "https://saadmalik1-visual-effects.hf.space/apply_video_effect/"
headers = {"X-API-Key": "trusted_dev_key"}
data = {"effect_name": "cartoon, frame_vlog"}
files = {"file": open("my_video.mp4", "rb")}

response = requests.post(url, headers=headers, data=data, files=files)
with open("result_video.mp4", "wb") as f:
    f.write(response.content)

Base64 (Python)

python
import requests
import base64

with open("image.jpg", "rb") as f:
    b64_string = base64.b64encode(f.read()).decode()

url = "https://saadmalik1-visual-effects.hf.space/apply_effect/"
data = {
    "image_base64": b64_string,
    "effect_name": "cartoon"
}
headers = {"X-API-Key": "trusted_dev_key"}

response = requests.post(url, headers=headers, data=data)

Binary File (Python)

python
import requests

url = "https://saadmalik1-visual-effects.hf.space/apply_effect/"
headers = {"X-API-Key": "trusted_dev_key"}
data = {"effect_name": "cartoon, frame_vlog"}
files = {"file": open("image.jpg", "rb")}

response = requests.post(url, headers=headers, data=data, files=files)
with open("output.jpg", "wb") as f:
    f.write(response.content)

cURL (Image Processing)

bash
curl -X POST "https://saadmalik1-visual-effects.hf.space/apply_effect/" \
     -H "X-API-Key: trusted_dev_key" \
     -F "file=@photo.jpg" \
     -F "effect_name=neon_edges, frame_neon" \
     --output result.jpg

cURL (Video Processing) ๐ŸŽฅ

bash
curl -X POST "https://saadmalik1-visual-effects.hf.space/apply_video_effect/" \
     -H "X-API-Key: trusted_dev_key" \
     -F "file=@my_video.mp4" \
     -F "effect_name=enhance_hdr, overlay_light_leak, frame_vlog" \
     --output result_video.mp4

cURL (Base64 Processing) ๐Ÿ”—

For Images:

bash
curl -X POST "https://saadmalik1-visual-effects.hf.space/apply_effect/" \
     -H "X-API-Key: trusted_dev_key" \
     -F "image_base64=YOUR_BASE64_STRING_HERE" \
     -F "effect_name=cartoon" \
     --output result.jpg

For Videos:

bash
curl -X POST "https://saadmalik1-visual-effects.hf.space/apply_video_effect/" \
     -H "X-API-Key: trusted_dev_key" \
     -F "video_base64=YOUR_BASE64_STRING_HERE" \
     -F "effect_name=enhance_hdr" \
     --output result_video.mp4

PowerShell (Windows)

powershell
$filePath = "C:\path\to\your\image.jpg"
Invoke-RestMethod -Uri "https://saadmalik1-visual-effects.hf.space/apply_effect/" `
    -Method Post `
    -Headers @{"X-API-Key"="trusted_dev_key"} `
    -Form @{
        file = Get-Item -Path $filePath
        effect_name = "cartoon, frame_vlog"
    } -OutFile "result.jpg"

๐Ÿ› ๏ธ Local Video Processing

You can also use the CLI for high-quality video processing with audio preservation:

bash
python process_video.py input.mp4 --effect "cartoon, frame_vlog" --output result.mp4

Developed with โค๏ธ by maliksaad1