| # HD French - Comic Story Generator Project Summary |
|
|
| ## Project Overview |
| This project generates comic stories with AI-generated characters and scenes using machine learning models. The system can create complete comic stories with multiple panels based on different themes. It now includes a web interface for easier story creation. |
|
|
| ## Current Status |
| The project has been successfully deployed to a remote server with NVIDIA RTX 3090 GPU and is fully functional. A new web interface has been added for easier access, along with scripts to manage the server and SSH tunnel. |
|
|
| ## Project Structure |
| ``` |
| βββ config.js # Main configuration file |
| βββ .env # API keys (not committed to Git) |
| βββ .env.example # Example API key configuration |
| βββ package.json # Node.js project configuration |
| βββ README.md # Project documentation |
| βββ server.js # Web server for frontend interface |
| βββ start_server_remote.sh # Script to start web server on remote server |
| βββ create_ssh_tunnel.sh # Script to create SSH tunnel |
| βββ create_ssh_tunnel_bg.sh # Script to create SSH tunnel in background |
| βββ start_web_interface.sh # Script to start web interface (combined) |
| βββ web/ # Web interface files |
| β βββ index.html # Main web interface |
| β βββ styles.css # Styling for web interface |
| β βββ script.js # Frontend logic |
| βββ src/ # Node.js source code |
| β βββ index.js # Main entry point (API version) |
| β βββ index.demo.js # Demo version |
| β βββ utils/ |
| β β βββ fireworks.js # Fireworks AI API client |
| β βββ models/ |
| β β βββ characterGenerator.js # Character generation |
| β β βββ personagene.js # Personagene creation |
| β βββ comics/ |
| β βββ storyGenerator.js # Comic story generation |
| βββ Python Scripts (on server) |
| β βββ stable_diffusion_generator.py # Image generation with Stable Diffusion |
| β βββ comic_story_generator.py # Complete comic story generation |
| β βββ comic_viewer.py # HTML viewer generation |
| ``` |
|
|
| ## Server Deployment |
| - **Server**: vast.ai instance |
| - **IP**: 207.102.87.207 |
| - **Port**: 53887 |
| - **User**: root |
| - **Workspace Directory**: /workspace/hd-french-setup |
| - **GPU**: NVIDIA RTX 3090 |
|
|
| ## Key Components |
|
|
| ### 1. Node.js Backend (Local Development) |
| - Configuration management |
| - Fireworks AI API integration |
| - Character and story generation logic |
| - Demo mode for testing without API keys |
| - Web server for frontend interface |
|
|
| ### 2. Python ML Components (Server) |
| - **Stable Diffusion Generator**: Creates individual images from text prompts |
| - **Comic Story Generator**: Creates complete 5-panel comic stories |
| - **Comic Viewer**: Generates HTML pages to view comic stories |
|
|
| ### 3. Web Interface |
| - **HTML/CSS/JS Frontend**: User-friendly interface for story creation |
| - **Web Server**: Serves frontend files and handles requests |
|
|
| ### 4. Management Scripts |
| - **start_server_remote.sh**: Starts web server on remote server in background |
| - **create_ssh_tunnel.sh**: Creates SSH tunnel to access web interface |
| - **create_ssh_tunnel_bg.sh**: Creates SSH tunnel in background |
| - **start_web_interface.sh**: Combined script to start web interface (server + tunnel) |
| |
| ## Recent Accomplishments |
| |
| ### Comic Story Generated |
| - **Title**: "The Quest for the Lost Artifact" |
| - **Theme**: Adventure |
| - **Character**: A brave elf warrior with silver armor and a magical sword |
| - **Setting**: Ancient ruins in a mystical forest |
| - **Panels Generated**: 5 |
| - **Directory**: comic_1756920589 |
| |
| ### Web Interface Added |
| - **Feature**: Browser-based interface for story creation |
| - **Technology**: HTML, CSS, JavaScript |
| - **Access**: Run `npm run web` and visit `http://localhost:8081` |
| |
| ### Management Scripts Added |
| - **Feature**: Easy management of remote server and SSH tunnel |
| - **Technology**: Bash scripts |
| - **Access**: Run `./start_server_remote.sh` and `./create_ssh_tunnel_bg.sh` |
| |
| ### Files Created on Server |
| 1. `comic_1756920589/panel_1.png` - Establishing shot |
| 2. `comic_1756920589/panel_2.png` - Character close-up |
| 3. `comic_1756920589/panel_3.png` - Action scene |
| 4. `comic_1756920589/panel_4.png` - Climactic scene |
| 5. `comic_1756920589/panel_5.png` - Resolution |
| 6. `comic_1756920589/story_metadata.json` - Story metadata |
| 7. `comic_1756920589/comic_story.html` - HTML viewer |
| |
| ## How to Access the Generated Comic |
| |
| ### SSH Connection |
| ```bash |
| ssh -p 53887 root@207.102.87.207 |
| cd /workspace/hd-french-setup |
| ``` |
| |
| ### View Generated Files |
| ```bash |
| ls -la comic_1756920589/ |
| ``` |
| |
| ### Download Files Locally |
| ```bash |
| scp -P 53887 root@207.102.87.207:/workspace/hd-french-setup/comic_1756920589/* . |
| ``` |
| |
| ## Running the System |
| |
| ### Local Demo (No API Required) |
| ```bash |
| npm run demo |
| ``` |
| |
| ### Web Interface |
| ```bash |
| # Start server on remote server |
| ./start_server_remote.sh |
| |
| # Create SSH tunnel (choose one): |
| ./create_ssh_tunnel.sh # Keeps terminal occupied |
| ./create_ssh_tunnel_bg.sh # Runs in background |
| |
| # Then visit http://localhost:8082 in your browser |
| ``` |
| |
| ### Server-Side Comic Generation |
| ```bash |
| # SSH into server |
| ssh -p 53887 root@207.102.87.207 |
| |
| # Navigate to project directory |
| cd /workspace/hd-french-setup |
| |
| # Generate new comic story |
| python3 comic_story_generator.py [theme] [title] |
| |
| # Generate HTML viewer for existing comic |
| python3 comic_viewer.py comic_1756920589 |
| ``` |
| |
| ## Supported Story Themes |
| 1. **Adventure** - Default theme |
| 2. **Mystery** - Detective stories |
| 3. **Romance** - Love stories |
|
|
| ## Performance Information |
| - **Image Generation Time**: 1-2 seconds per panel on RTX 3090 |
| - **Complete Story Generation**: 2-3 minutes for 5 panels |
| - **Model Used**: Stable Diffusion v1.5 (public access) |
|
|
| ## Future Improvements |
| 1. Integration with Flux Schnell model (requires Hugging Face access) |
| 2. Enhanced web interface with real API integration |
| 3. Custom character creation tools |
| 4. Additional story themes and templates |
| 5. User account system for saving stories |
|
|
| ## Troubleshooting |
|
|
| ### Common Issues |
| 1. **Hugging Face Access**: Flux Schnell requires authorized access |
| 2. **GPU Memory**: Large models may require significant VRAM |
| 3. **Network Latency**: SSH connections may have delays |
| 4. **Web Interface**: Ensure port 8081 is available |
|
|
| ### Solutions |
| 1. Use Stable Diffusion as alternative (already implemented) |
| 2. Monitor GPU usage with `nvidia-smi` |
| 3. Use background processes for long-running tasks |
| 4. Check for port conflicts when running web server |
|
|
| ## Git Repository |
| The project is version controlled with Git. Current commit: 0047d5b6 |
|
|
| ## Next Steps |
| 1. Continue developing additional features |
| 2. Test with different story themes |
| 3. Optimize image generation parameters |
| 4. Enhance web interface with real API integration |
| 5. Add user account system for saving stories |
|
|
| --- |
| *Document created: September 3, 2025* |
| *Project Status: Fully functional with active server deployment, web interface, and management scripts* |
|
|