Version: 2.0 (Advanced Edition)
Author: Creative Studio Team
License: MIT
Advanced AI-powered creative content generation suite. Generate professional marketing assets including social cards, data visualizations, AI-generated content, and complete marketing campaigns.
| Feature | Description | Status |
|---|---|---|
| --------- | ------------- | -------- |
| 🖼️ Social Card Generation | 4 card styles (modern, gradient, minimal, bold) | ✅ |
| 📊 Data Visualization | Bar, line, pie, radar, scatter, heatmap, stacked charts | ✅ |
| 🤖 AI Content Generation | GPT-4 powered content with fallback mode | ✅ |
| ⚡ Batch Processing | Generate multiple assets simultaneously | ✅ |
| 🛠️ Image Effects | Watermark, blur, brightness, contrast, border | ✅ |
| 🌐 Interactive Charts | Plotly-powered HTML charts | ✅ |
| 📦 Complete Campaigns | Orchestrated multi-asset generation | ✅ |
| 🎬 Video Scripts | AI-generated video scripts | ✅ |
| 📝 SEO Content | Optimized content with meta tags | ✅ |
| 🖼️ AI Image Variations | DALL-E 3 integration (with fallback) | ✅ |
Core dependencies (required for basic features):
cd E:\skills\creative-content-studio\scripts
pip install -r requirements.txt
Required packages:
| Package | Version | Purpose |
|---|---|---|
| --------- | --------- | --------- |
| Pillow | >=10.0.0 | Image generation |
| requests | >=2.28.0 | HTTP API calls |
| python-dateutil | >=2.8.0 | Date handling |
Optional packages (for advanced features):
| Package | Version | Purpose |
|---|---|---|
| --------- | --------- | --------- |
| matplotlib | >=3.7.0 | Data visualization |
| seaborn | >=0.12.0 | Enhanced chart styles |
| openai | >=1.0.0 | AI content generation |
| streamlit | >=1.28.0 | Web UI |
| numpy | >=1.24.0 | Numerical computations |
| pandas | >=2.0.0 | Data analysis |
| plotly | >=5.0.0 | Interactive charts |
# Test imports
python -c "from creative_studio import ContentGenerator; print('✅ Imports OK')"
# List available templates
python creative_studio.py list-templates
# Test image generation (requires Pillow)
python creative_studio.py social-card "Hello" --output test.png
streamlit run app.py
# Open http://localhost:8501
python creative_studio.py campaign --config demo_complete.json --output demo_output
> Note: See demo_complete.json for comprehensive examples of all features.
# Basic social card
python creative_studio.py social-card "Hello World" --subtitle "Welcome" --output card.png
# With custom style
python creative_studio.py social-card "Sale" --color "#FF6B6B" --style bold --output sale.png
# With effects
python creative_studio.py image-effect watermark card.png --param "© Brand" --output marked.png
python creative_studio.py image-effect blur card.png --param 5 --output blurred.png
# Bar chart
python creative_studio.py viz bar --data '{"抖音":12500,"小红书":8900}' --title "用户增长" --output chart.png
# Line chart
python creative_studio.py viz line --data '{"2024":[100,150,200],"2023":[80,110,130]}' --title "收入趋势" --output trend.png
# Pie chart
python creative_studio.py viz pie --data '{"一线城市":35,"二线城市":28}' --title "用户分布" --output pie.png
# Batch social cards
python creative_studio.py batch-social --config cards.json --output output/cards
# Batch visualizations
python creative_studio.py batch-viz --config charts.json --output output/charts
# Complete campaign
python creative_studio.py campaign --config demo_complete.json --output output/campaign
# Generate content
python creative_studio.py ai-generate "Write a product launch announcement"
# Custom parameters
python creative_studio.py ai-generate "Write Twitter posts" --model gpt-3.5-turbo --max-tokens 500
The skill includes multiple demo files for testing and learning:
| File | Description | Use Case |
|---|---|---|
| ------ | ------------- | --------- |
demo_social_cards.json | 5 basic social card configs | Quick testing |
demo_campaign.json | Basic campaign with 5 cards, 3 charts | Learning basic features |
demo_complete.json | Complete campaign with 6 cards, 4 charts, 4 content items | Full feature demonstration |
test_data.json | Test data for unit testing | Development/debugging |
from creative_studio import (
AdvancedImageGenerator,
AdvancedVisualizer,
AdvancedContentTemplate,
AIContentGenerator,
ContentBatchProcessor,
CampaignGenerator
)
# Initialize with optional config
config = {
'default_size': (1024, 1024),
'colors': ['#4A90E2', '#50C878'],
'openai_api_key': 'your-key'
}
# Image Generation
gen = AdvancedImageGenerator(config)
image_bytes = gen.create_social_card("Title", "Subtitle", "#4A90E2", "modern")
# Save image
gen.save_image(image_bytes, "output.png")
# Apply effects
watermarked = gen.apply_watermark(image_bytes, "© Brand")
blurred = gen.apply_blur(image_bytes, radius=5)
with_border = gen.add_border(image_bytes, width=10)
# Create collage
collage = gen.create_collage([img1, img2, img3], layout='grid')
from creative_studio import AdvancedVisualizer
viz = AdvancedVisualizer()
# Bar chart
viz.create_bar_chart({"抖音":12500,"小红书":8900}, "用户增长", "chart.png")
# Line chart with multiple series
viz.create_line_chart(
{"2024":[100,150,200],"2023":[80,110,130]},
"收入对比",
x_labels=["Q1","Q2","Q3"],
output_path="trend.png",
show_area=True
)
# Pie chart
viz.create_pie_chart({"一线":35,"二线":28,"其他":37}, "市场分布", "pie.png")
# Radar chart
viz.create_radar_chart(
{"产品A":[80,70,90],"产品B":[70,80,75]},
"产品对比",
labels=["功能","价格","服务","质量"],
output_path="radar.png"
)
# Scatter plot
viz.create_scatter_plot([10,20,30],[25,45,35],"散点图","scatter.png")
# Heatmap
viz.create_heatmap([[1,2,3],[4,5,6]], "热力图", "heatmap.png")
# Interactive HTML (Plotly)
html = viz.create_interactive_chart({"抖音":12500,"小红书":8900}, "用户", "bar")
from creative_studio import AdvancedContentTemplate
template = AdvancedContentTemplate()
# List available templates
templates = template.list_templates()
# Get template schema
schema = template.get_template('social_post')
# Generate content
result = template.generate_content('social_post', {
'headline': '🚀 新功能发布',
'body': '我们很高兴宣布...',
'hashtags': ['#AI', '#Innovation'],
'cta': '立即体验 →'
})
# Validate data
valid, errors = template.validate_data('social_post', data)
from creative_studio import AIContentGenerator
ai = AIContentGenerator({'openai_api_key': 'your-key'})
# Generate content
content = ai.generate("Write an engaging product announcement")
# Batch generation
batch = ai.generate_batch(["Post 1", "Post 2", "Post 3"])
# Platform optimization
optimized = ai.optimize_for_platform(content, "twitter")
# Hashtag suggestions
hashtags = ai.suggest_hashtags(content, "instagram", 10)
# Image prompt optimization
prompt = ai.generate_image_prompt("a modern office", style="corporate", platform="midjourney")
from creative_studio import ContentBatchProcessor
batch = ContentBatchProcessor()
# Batch social cards
results = batch.batch_social_cards([
{'title': 'Card 1', 'subtitle': 'Sub 1', 'filename': 'card1.png'},
{'title': 'Card 2', 'subtitle': 'Sub 2', 'filename': 'card2.png'}
], 'output/cards')
# Batch visualizations
viz_results = batch.batch_visualizations({
'charts': [
{'type': 'bar', 'title': 'Chart 1', 'data': {...}, 'filename': 'c1.png'},
{'type': 'pie', 'title': 'Chart 2', 'data': {...}, 'filename': 'c2.png'}
]
}, 'output/charts')
# Batch content
content_results = batch.batch_content_generation([
{'template': 'social_post', 'data': {...}},
{'template': 'product_ad', 'data': {...}}
])
from creative_studio import CampaignGenerator
generator = CampaignGenerator()
campaign_config = {
'name': 'product_launch',
'settings': {
'output_dir': 'campaign_output',
'brand_color': '#4A90E2'
},
'social_cards': [
{'title': '🚀 Launch', 'subtitle': 'New features', 'filename': 'launch.png'}
],
'visualizations': [
{'type': 'bar', 'title': 'Growth', 'data': {...}, 'filename': 'growth.png'}
],
'content': [
{'template': 'social_post', 'data': {...}}
],
'ai_content': [
{'prompt': 'Write launch announcement'}
]
}
results = generator.generate_complete_campaign(campaign_config, 'output')
# Access results
print(results['stats'])
print(results['assets'])
print(results['summary'])
Error: "ModuleNotFoundError: No module named 'Pillow'"
pip install Pillow>=10.0.0
Error: "ModuleNotFoundError: No module named 'matplotlib'"
pip install matplotlib>=3.7.0 seaborn>=0.12.0
Error: "ModuleNotFoundError: No module named 'streamlit'"
pip install streamlit>=1.28.0 watchdog>=3.0.0
Error: "No module named 'openai'"
pip install openai>=1.0.0
> Note: OpenAI integration is optional. Without it, the tool falls back to template-based generation.
Error: "No module named 'plotly'"
pip install plotly>=5.0.0
> Note: Plotly is optional for interactive HTML charts.
Error: "No module named 'numpy'" or "pandas"
pip install numpy>=1.24.0 pandas>=2.0.0
Error: "Pillow not installed"
pip install PillowError: "matplotlib not installed"
pip install matplotlib seabornError: "OpenAI API error"
echo $OPENAI_API_KEYsetx OPENAI_API_KEY "your-key" (Windows) or export OPENAI_API_KEY="your-key" (Mac/Linux)AIContentGenerator({'openai_api_key': 'your-key'})Error: "Config file not found"
dir demo_complete.json--config "E:\skills\creative-content-studio\scripts\demo_complete.json"Test-Path demo_complete.jsonError: "streamlit: command not found"
pip install streamlit
Error: "Port 8501 already in use"
streamlit run app.py --server.port 8502
Error: "Web UI not loading"
python --version (needs 3.8+)pip uninstall streamlit && pip install streamlitstreamlit cache clearError: "Permission denied" (Windows)
python -m venv .venvError: "UnicodeDecodeError"
encoding='utf-8' in file operationsError: "File path too long" (Windows)
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1| Effect | Description | Parameters |
|---|---|---|
| -------- | ------------- | ------------ |
watermark | Add text watermark | text, position, opacity |
blur | Gaussian blur | radius (default: 5) |
brightness | Adjust brightness | factor (default: 1.5) |
contrast | Adjust contrast | factor (default: 1.5) |
border | Add border | width, color |
resize | Resize image | width, height, maintain_aspect |
crop | Crop to ratio | target_ratio |
| Type | Description | Best For |
|---|---|---|
| ------ | ------------- | ---------- |
bar | Vertical/horizontal bars | Comparisons |
line | Line with markers | Trends over time |
pie | Pie/donut chart | Proportions |
radar | Spider/radar | Multi-variable comparison |
scatter | Scatter plot | Correlations |
heatmap | Color-coded matrix | Complex data patterns |
stacked | Stacked bars/area | Part-to-whole |
| Template | Fields | Platform |
|---|---|---|
| ---------- | -------- | ---------- |
social_post | headline, body, hashtags, cta | Twitter, Instagram |
product_ad | product, headline, features, price | Universal |
blog_post | title, intro, sections, conclusion | SEO/Web |
email_campaign | subject, preview, body, highlights | |
video_script | title, scenes, voiceover | YouTube/TikTok |
seo_content | keyword, meta, content | Google/Web |
| Model | Use Case | Cost |
|---|---|---|
| ------- | ---------- | ------ |
gpt-4 | High-quality content | Higher |
gpt-3.5-turbo | Fast, affordable | Lower |
| DALL-E 3 | AI image generation | Per image |
| Fallback | Template-based (free) | Free |
{
"settings": {
"output_dir": "output",
"default_size": [1024, 1024],
"brand_color": "#4A90E2"
},
"social_cards": [
{
"title": "🚀 新功能",
"subtitle": "体验升级",
"color": "#4A90E2",
"style": "modern",
"filename": "feature.png"
}
]
}
{
"name": "product_launch",
"settings": {
"output_dir": "campaign_output",
"brand_name": "Acme Corp",
"brand_color": "#4A90E2"
},
"social_cards": [
{"title": "Card 1", "subtitle": "Sub 1", "filename": "c1.png", "style": "modern"},
{"title": "Card 2", "subtitle": "Sub 2", "filename": "c2.png", "style": "bold"}
],
"visualizations": [
{
"type": "bar",
"title": "用户增长",
"data": {"抖音": 12500, "小红书": 8900},
"filename": "growth.png"
},
{
"type": "line",
"title": "收入趋势",
"data": {"2024": [100, 150, 200]},
"x_labels": ["Q1", "Q2", "Q3"],
"filename": "trend.png"
}
],
"content": [
{
"template": "social_post",
"data": {
"headline": "产品发布",
"body": "我们很高兴宣布...",
"hashtags": ["#AI", "#Launch"]
}
}
],
"ai_content": [
{"prompt": "Write a compelling product launch announcement"}
]
}
--size parameter to controlstreamlit cache clear to resetcreative_studio/
├── SKILL.md # This documentation
├── scripts/
│ ├── creative_studio.py # Core module (71KB, Pro Edition)
│ ├── app.py # Streamlit web UI (48KB)
│ ├── requirements.txt # Dependencies
│ ├── INSTALL.md # Installation guide
│ ├── demo_complete.json # Complete demo config
│ ├── demo_campaign.json # Basic campaign demo
│ ├── demo_social_cards.json # Social cards demo
│ └── test_data.json # Test fixtures
└── assets/
└── example_asset.txt
MIT License - Free for personal and commercial use.
For issues:
demo_complete.json for working examplespython -v creative_studio.py ...Version History:
共 1 个版本