python+html实现ai短剧电影工具bfwfilmer手动seedance2版本代码

代码语言:python

所属分类:其他

代码描述:python+html实现ai短剧电影工具bfwfilmer手动seedance2版本代码,输入创作主题或剧本,自动生成ai提示词,复制提示词到任何免费ai聊天中可生成json剧本及seedance2的专用视频提示词还有角色道具场景的文生图提示词,复制到免费的文生图中生成角色场景道具照片,然后结合分镜seedance2提示词参考这些角色场景道具图片生成角色场景一致性的免费视频。

代码标签: python html ai 短剧 电影 工具 bfwfilmer 手动 seedance 版本

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

#!/usr/bin/env python3
"""
手动AI短剧生成器工具 (专业商用版)
使用 Python + 内嵌HTML 实现,支持多项目管理、风格定制、极简暗黑UI、参考图映射、道具系统
"""

import http.server
import json
import os
import shutil
import socketserver
import urllib.parse
import mimetypes
from pathlib import Path
import subprocess

PORT = 8080
UPLOAD_DIR = Path("uploads")
PROJECTS_DIR = UPLOAD_DIR / "projects"
PROJECTS_DIR.mkdir(parents=True, exist_ok=True)

HTML_CONTENT = r'''<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI短剧创作工作台</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
    --bg-base: #09090b;
    --bg-surface: #18181b;
    --bg-surface-hover: #27272a;
    --border: #27272a;
    --border-hover: #3f3f46;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --warning: #f59e0b;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: rgba(24, 24, 27, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .brand {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}
.navbar .brand-icon {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 22px;
}
.navbar .project-info {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Layouts */
.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.hidden { display: none !important; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-surface-hover); border-color: var(--border-hover); }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Dashboard Cards */
.grid-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}
.project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.project-card h3 { font-size: 18px; margin-bottom: 8px; font-weight: 600; }
.project-card .meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; }
.project-card .tags { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tag {
    background: var(--bg-base);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-secondary);
}
.project-card .actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Forms & Inputs */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
input[type="text"], input[type="number"], textarea, select {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    transition: border 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}
textarea { resize: vertical; min-height: 100px; }

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%; max-width: 500px;
    padding: 30px;
    box-shadow: var(--shadow);
    transform: translateY(20px);
    transition: transform 0.3s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h2 { font-size: 20px; font-weight: 600; }
.close-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 20px; }

/* Stepper */
.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}
.stepper::before {
    content: '';
    position: absolute;
    top: 16px; left: 0; right: 0;
    height: 2px;
    background: var(--border);
    z-index: 1;
}
.step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 25%;
}
.step .circle {
    width: 34px; height: 34px;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s;
}
.step.active .circle {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}
.step.completed .circle {
    border-color: var(--success);
    color: var(--success);
}
.step .label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.step.active .label { color: var(--text-primary); }

/* Workspace Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}
.card-header {
    display: flex; align-item.........完整代码请登录后点击上方下载按钮下载查看

网友评论0