๐ Revolutionary AI-powered NFT SDK with nano-banana multimodal intelligence
Project description
๐ฆ Recreate.ai NFT SDK
The easiest way to generate AI-powered NFT collections in Python.
Transform any image into stylized NFT collections using OpenRouter, Gemini, or OpenAI. No complex setup required!
๐ Quick Start
Installation
pip install recreate-nft-sdk
Basic Usage
from recreate_nft import RecreateNFT
# Initialize with your API key (OpenRouter, Gemini, or OpenAI)
nft = RecreateNFT(api_key="your_openrouter_key")
# Generate a single styled image
result = nft.create_image("photo.jpg", style="adventure_time")
result.save_image("styled_photo.jpg")
# Generate full NFT collection
collection = nft.create_collection(
image_path="photo.jpg",
style="crypto_punks",
collection_size=40,
name="My Punk Collection"
)
# Save collection to disk
nft.save_collection(collection, "my_nft_collection/")
# Deploy to blockchain (mock)
deployment = nft.deploy_collection(collection, "ethereum")
print(f"Deployed! OpenSea URL: {deployment.opensea_url}")
That's it! ๐
โจ Features
- ๐จ 15+ Styles: Adventure Time, Rick & Morty, CryptoPunks, Bored Apes, Anime, and more
- ๐ค Multi-AI Support: OpenRouter, Google Gemini, OpenAI
- ๐ Easy Collection Generation: Generate 10-100 NFTs with automatic rarity distribution
- ๐ฏ Smart Trait System: 10+ trait categories per style with realistic rarity
- ๐ Multi-Network: Ethereum, Polygon, Base, Arbitrum support
- ๐พ Export Ready: Save images + metadata in OpenSea-compatible format
- ๐ง CLI Tool: Command-line interface for quick operations
- ๐ฑ Lightweight: Minimal dependencies, maximum performance
๐จ Supported Styles
Cartoon Network & Animation
- adventure_time - Mathematical Land of Ooo aesthetic
- rick_morty - Interdimensional sci-fi chaos
- gravity_falls - Mysterious Pacific Northwest vibes
- steven_universe - Gem magic with pastel colors
- simpsons - Classic Springfield yellow
- south_park - Cut-out paper animation
Crypto Collections
- crypto_punks - 8-bit pixel art rebels
- bored_apes - Yacht Club premium vibes
- azuki - Anime streetwear aesthetic
- labubu - Designer toy collectible cuteness
Artistic Styles
- anime - Japanese animation style
- cartoon - Western cartoon style
- realistic - Photorealistic rendering
- pixel - 8-bit pixel art
- watercolor - Artistic painting style
๐ Complete Examples
Single Image Generation
from recreate_nft import RecreateNFT
# Initialize client
nft = RecreateNFT(
api_key="your_openrouter_key",
provider="openrouter" # or "gemini", "openai"
)
# Create styled image
result = nft.create_image(
image_path="my_photo.jpg",
style="adventure_time",
aspect_ratio="1:1"
)
# Save result
result.save_image("adventure_time_style.jpg")
print(f"โ
Created {result.style_id} style image!")
NFT Collection Generation
from recreate_nft import RecreateNFT, RaritySettings
# Custom rarity distribution
rarity = RaritySettings(
common=50, # 50%
uncommon=30, # 30%
rare=15, # 15%
legendary=5 # 5%
)
# Generate collection
collection = nft.create_collection(
image_path="base_image.jpg",
style="crypto_punks",
collection_size=100,
name="My Punk Collection",
description="AI-generated punk-style NFT collection",
rarity_settings=rarity
)
# Analyze results
print(collection.summary())
# Access individual NFTs
for token in collection.legendary_tokens:
print(f"Legendary NFT #{token.token_id}: {len(token.traits)} traits")
token.save_image(f"legendary_{token.token_id}.png")
# Save entire collection
nft.save_collection(collection, "punk_collection_output/")
Advanced Collection Analysis
# Detailed collection analysis
print(f"๐ Collection: {collection.name}")
print(f"๐จ Style: {collection.style}")
print(f"๐ Total NFTs: {len(collection.tokens)}")
# Rarity breakdown
rarities = ["common", "uncommon", "rare", "legendary"]
for rarity in rarities:
tokens = collection.get_tokens_by_rarity(rarity)
percentage = collection.get_rarity_percentage(rarity)
print(f" โข {rarity.title()}: {len(tokens)} NFTs ({percentage:.1f}%)")
# Find rarest NFT
legendary_nfts = collection.legendary_tokens
if legendary_nfts:
rarest = max(legendary_nfts, key=lambda t: len(t.traits))
print(f"๐ Rarest NFT: #{rarest.token_id} with {len(rarest.traits)} traits")
Blockchain Deployment
# Deploy to different networks
networks = ["ethereum", "polygon", "base", "arbitrum"]
for network in networks:
try:
deployment = nft.deploy_collection(collection, network)
if deployment.success:
print(f"โ
{network.title()}: {deployment.contract_address}")
print(f" OpenSea: {deployment.opensea_url}")
print(f" Cost: {deployment.deployment_cost}")
except Exception as e:
print(f"โ {network} deployment failed: {e}")
๐ฅ๏ธ CLI Usage
The SDK includes a powerful command-line interface:
# Install with CLI support
pip install recreate-nft-sdk
# Set your API key
export RECREATE_API_KEY="your_openrouter_key"
# Generate single image
recreate-nft create-image photo.jpg adventure_time --output styled.jpg
# Generate NFT collection
recreate-nft create-collection photo.jpg crypto_punks \
--size 50 \
--name "My Collection" \
--output-dir my_nfts/ \
--rare 20 \
--legendary 5
# List available styles
recreate-nft list-styles
# Deploy collection
recreate-nft deploy collection_metadata.json ethereum
๐ง Configuration
API Provider Setup
OpenRouter (Recommended):
nft = RecreateNFT(
api_key="sk-or-v1-...",
provider="openrouter"
)
Google Gemini:
nft = RecreateNFT(
api_key="your_gemini_key",
provider="gemini"
)
OpenAI:
nft = RecreateNFT(
api_key="sk-...",
provider="openai"
)
Environment Variables
# Primary API key
export RECREATE_API_KEY="your_api_key"
# Alternative names
export OPENROUTER_API_KEY="your_openrouter_key"
export GEMINI_API_KEY="your_gemini_key"
export OPENAI_API_KEY="your_openai_key"
# Custom backend (if self-hosting)
export RECREATE_BACKEND_URL="http://localhost:8000"
Custom Backend
# Use custom Recreate backend
nft = RecreateNFT(
api_key="your_key",
backend_url="https://your-backend.com"
)
๐ฏ Rarity System
The SDK uses a realistic rarity distribution system:
| Rarity | Default % | Traits | Visual |
|---|---|---|---|
| Common | 60% | 1-3 traits | Gray |
| Uncommon | 25% | 2-4 traits | Blue |
| Rare | 12% | 3-5 traits | Orange |
| Legendary | 3% | 4-6+ traits | Purple |
Custom Rarity Settings
from recreate_nft import RaritySettings
# Create custom distribution
custom_rarity = RaritySettings(
common=40,
uncommon=35,
rare=20,
legendary=5
)
collection = nft.create_collection(
"image.jpg",
"bored_apes",
rarity_settings=custom_rarity
)
๐ Output Format
The SDK generates OpenSea-compatible metadata:
my_collection/
โโโ collection_metadata.json # Collection info
โโโ nft_001.png # NFT images
โโโ nft_001_metadata.json # Individual metadata
โโโ nft_002.png
โโโ nft_002_metadata.json
โโโ ...
Metadata Example:
{
"name": "My Collection #1",
"description": "NFT #1 from My Collection",
"image": "nft_001.png",
"attributes": [
{"trait_type": "Background", "value": "Candy Kingdom"},
{"trait_type": "Mood", "value": "Algebraic"},
{"trait_type": "Accessory", "value": "Finn's Hat"}
],
"rarity": "rare"
}
๐ Error Handling
from recreate_nft import RecreateNFT, RecreateError, APIError, ValidationError
try:
nft = RecreateNFT(api_key="invalid_key")
result = nft.create_image("photo.jpg", "adventure_time")
except ValidationError as e:
print(f"Invalid input: {e}")
except APIError as e:
print(f"API error: {e}")
except RecreateError as e:
print(f"SDK error: {e}")
๐ Performance Tips
- Batch Operations: Generate collections in one call rather than individual images
- Image Optimization: The SDK automatically optimizes images to 1024px max
- Progress Tracking: Use
show_progress=Truefor long operations - Error Recovery: The SDK handles API timeouts and retries automatically
๐ Security
- API keys are never logged or stored
- Image data is processed securely via HTTPS
- No persistent data storage
- Rate limiting handled automatically
๐ API Reference
RecreateNFT Class
__init__(api_key, provider, backend_url)
Initialize the client.
create_image(image_path, style, aspect_ratio) -> ImageResult
Generate single styled image.
create_collection(image_path, style, collection_size, ...) -> NFTCollection
Generate NFT collection with rarity traits.
deploy_collection(collection, network) -> DeploymentResult
Deploy collection to blockchain.
save_collection(collection, output_dir)
Save collection to disk.
list_styles() -> List[str]
Get supported styles.
list_networks() -> List[str]
Get supported networks.
๐ค Contributing
We welcome contributions! Please see our Contributing Guide.
๐ License
MIT License - see LICENSE for details.
๐ Support
- ๐ Documentation
- ๐ Bug Reports
- ๐ฌ Discord Community
- ๐ง Email Support
๐ Examples Gallery
Check out amazing collections created with the SDK:
Made with ๐ฆ by the Recreate.ai team
Transform any image into an NFT collection in minutes, not months!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file banana-nft-sdk-2.0.0.tar.gz.
File metadata
- Download URL: banana-nft-sdk-2.0.0.tar.gz
- Upload date:
- Size: 60.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0063d41baf2a03ef3233734805f5e0bd77927d424f90f8a34e48621cff529997
|
|
| MD5 |
578e0620a728b452c0a0fbfb34c02401
|
|
| BLAKE2b-256 |
aaf23760809f8f5ebbd2f8ce7af283c88c40993bb4904af8a16d8d125aaef4d4
|
File details
Details for the file banana_nft_sdk-2.0.0-py3-none-any.whl.
File metadata
- Download URL: banana_nft_sdk-2.0.0-py3-none-any.whl
- Upload date:
- Size: 60.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f10b4d94b08aa9d093ae554c5abf34334e4a9fa184ffd945d70ff0303a6eedf
|
|
| MD5 |
80e08c27c8c1610eb68e62dfc8724eaf
|
|
| BLAKE2b-256 |
f169d843ad6789a931e8000687e343bdba65b72710422cf152d65373001008b2
|