saadmalik1/Visual_Effects
0
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, andframe_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 eitherfileorimage_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)
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)
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)
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)
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.jpgcURL (Video Processing) ๐ฅ
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.mp4cURL (Base64 Processing) ๐
For Images:
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.jpgFor Videos:
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.mp4PowerShell (Windows)
$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:
python process_video.py input.mp4 --effect "cartoon, frame_vlog" --output result.mp4Developed with โค๏ธ by maliksaad1
