A command-line tool for upscaling and enhancing images using the Venice AI API. This tool provides a simple interface to access Venice AI's powerful image upscaling and enhancement capabilities.
This project is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License - see the LICENSE file for details.
- Upscale images by 1x, 2x, or 4x
- AI-powered image enhancement
- Style transfer using text prompts
- Automatic image resizing for large files
- Detailed logging and error reporting
- JSON output for programmatic use
- Available as both Python script and Windows executable
- Python 3.6 or higher (for running from source)
- Internet connection
- Venice AI API key
- Download the latest release from the releases page
- Extract the ZIP file
- Create a
.envfile in the same directory as the executable with your API key:VENICE_API_KEY=your_api_key_here - Run
venice-upscaler.exedirectly
- Clone this repository or download the source files
- Install required dependencies:
pip install -r requirements.txt
- Create a
.envfile in the project root with your API key:VENICE_API_KEY=your_api_key_here
To build the Windows executable yourself:
-
Install the requirements:
pip install -r requirements.txt
-
Create a
.envfile in the project root with your API key:VENICE_API_KEY=your_api_key_here -
Run the build script:
python build.py
-
The executable will be created in the
builddirectory along with necessary documentation
Note: Building requires Windows and Python 3.6 or higher. The build process will create a build directory containing:
venice-upscaler.exe: The compiled executableREADME.md: Documentationrequirements.txt: Python dependencies (for reference)
The script uses environment variables for configuration:
VENICE_API_KEY: Your Venice AI API key (required)- Maximum file size: 4.5MB (automatically resizes larger images)
- Default scale factor: 2x
- Default enhancement creativity: 0.5
- Default replication: 0.35
# Basic upscaling (2x)
venice-upscaler.exe image.jpg
# Custom scale factor
venice-upscaler.exe -s 4 image.jpg
# Enable enhancement
venice-upscaler.exe -e image.jpg
# Full enhancement with custom parameters
venice-upscaler.exe -e -c 0.8 -p "gold" -r 0.5 image.jpg# Basic upscaling (2x)
python upscale.py image.jpg
# Custom scale factor
python upscale.py -s 4 image.jpg
# Enable enhancement
python upscale.py -e image.jpg
# Full enhancement with custom parameters
python upscale.py -e -c 0.8 -p "gold" -r 0.5 image.jpg| Option | Short | Description |
|---|---|---|
--scale |
-s |
Scale factor (1.0, 2.0, or 4.0). Scale of 1.0 requires --enhance |
--enhance |
-e |
Enable image enhancement during upscaling |
--enhance-creativity |
-c |
Enhancement creativity level (0.0 to 1.0) |
--enhance-prompt |
-p |
Text prompt for enhancement style |
--replication |
-r |
Line and noise preservation level (0.0 to 1.0) |
--verbose |
-v |
Enable verbose logging |
--version |
Show version information |
-
Enhancement Creativity (
-c): Controls how much the AI can modify the image- 0.0: Minimal changes
- 1.0: Maximum creative freedom
- Default: 0.5
-
Enhancement Prompt (
-p): Text description of desired style- Examples: "gold", "marble", "angry", "menacing"
- Maximum length: 1500 characters
- Optional
-
Replication (
-r): Controls preservation of original image details- 0.0: Maximum preservation
- 1.0: Maximum enhancement
- Default: 0.35
- Minimum dimensions: 65536 pixels total
- Maximum dimensions after scaling: 16777216 pixels
- Supported formats: PNG, JPEG/JPG
- Maximum file size: 4.5MB (larger files are automatically resized)
The script outputs JSON responses for both success and failure cases:
Success example:
{
"success": true,
"output_path": "upscaled_image.jpg",
"scale_factor": 2.0,
"enhance": true,
"enhance_creativity": 0.8,
"enhance_prompt": "gold",
"replication": 0.5
}Error example:
{
"success": false,
"error": "Error message here"
}# 2x upscale
venice-upscaler.exe image.jpg
# 4x upscale
venice-upscaler.exe -s 4 image.jpg# Enhance without upscaling
venice-upscaler.exe -s 1 -e image.jpg
# Enhance with gold style
venice-upscaler.exe -s 1 -e -p "gold" image.jpg# Enhance with custom parameters
venice-upscaler.exe -e -c 0.8 -p "marble" -r 0.5 image.jpg
# 4x upscale with enhancement
venice-upscaler.exe -s 4 -e -c 0.7 -p "angry" image.jpg# Show detailed processing information
venice-upscaler.exe -v image.jpg
# Verbose with all options
venice-upscaler.exe -v -s 4 -e -c 0.7 -p "marble" image.jpgThe script handles various error conditions:
- File not found
- Invalid image dimensions
- API errors
- Invalid parameter combinations
- File size limits
- Missing API key
All errors are reported in JSON format with descriptive messages.
The script provides two levels of logging:
-
Standard (default):
- Basic progress information
- Error messages
- Success confirmations
-
Verbose (
-v):- Detailed API request information
- Image processing details
- Parameter validation
- Response headers
- Debug information
- Maximum input file size: 4.5MB (larger files are automatically resized)
- Scale factors limited to 1.0, 2.0, or 4.0
- Enhancement parameters limited to 0.0-1.0 range
- Minimum image size: 65536 pixels
- Maximum output size: 16777216 pixels
Common issues and solutions:
-
API Error: 401 Unauthorized
- Check your API key in the
.envfile - Ensure the
.envfile is in the correct location - Verify the API key is valid
- Check your API key in the
-
File too large
- The script will automatically resize large files
- Check the logs for resizing information
-
Invalid dimensions
- Ensure your image meets the minimum size requirement
- Check the logs for dimension information
-
Enhancement not working
- Ensure you're using
-eflag - For scale 1.0, enhancement is required
- Ensure you're using
-
Executable not working
- Ensure you have the latest Visual C++ Redistributable installed
- Try running from command prompt to see error messages
- Check if your antivirus is blocking the executable
- Verify the
.envfile exists and contains a valid API key
Feel free to submit issues and enhancement requests!
This project is licensed under the MIT License - see the LICENSE file for details.