Skip to content

Latest commit

Β 

History

104 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 English Β  | Β  πŸ‡ΉπŸ‡· TΓΌrkΓ§e

Thena Logo

THENA

Next-Generation Client-Side AI Ecosystem: Image Generation, Roleplay Chat, Image Editor & Visual Stories

Version 3.8.0 Issues Stars License Platform Vanilla JS

Transform your imagination into stunning visuals and interactive stories in seconds β€” zero server dependencies, entirely running client-side.
Launch Web App




πŸ—‚οΈ Table of Contents


πŸš€ About The Project

Thena is a high-performance, browser-native AI creative platform engineered entirely with Vanilla JavaScript, HTML5, and CSS3 (no heavy frameworks, no React/Vue compilation). By harnessing modern Web APIs, it delivers a desktop-grade, zero-backend suite for content creation, narrative generation, and visual storytelling directly inside a web tab.

The platform is designed around four key pillars:

Pillar Architecture & Purpose
🎨 AI Image Generation Multi-model, multi-style synthesis utilizing custom API endpoints with real-time prompt feedback.
πŸ€– AI Roleplay Chat Fully immersive conversational engine with custom character metadata, memory integration, and sentiment analysis.
πŸ–ΌοΈ Image Editor Canvas-level pixel manipulation, AI outpainting, upscaling, blending (fusion), and human-focused Gender Swapping.
πŸ“– AI Stories (Thena Toons) A smooth webtoon-style graphic novel reader with lazy-loaded image pipelines.

✨ Key Features

🎨 Advanced Image Generation

  • Multi-Model Engine β€” Start creating with Thena's own image generation models, as well as the most advanced image models worldwide, including the newly added Midjourney V8.1 model!
  • Multi-Image Generation & Saving β€” Upgraded generation pipeline to handle multiple parallel images returned in a single API payload, automatically saving all results into the local database.
  • Precise Aspect Ratios β€” Built-in aspect adapters for Standard (1:1), Portrait (3:4, 9:16), and Widescreen (16:9, 4:3) ratios.
  • Optimization Modes β€” Choose between Fast Mode for rapid iterations, Creative & Dense for structural complexity, and HighRes for supersampled rendering.
  • Prompt Engineering Tools:
    • Magic Wand ✨ β€” Automatically expands short, descriptive phrases into highly detailed prompts.
    • Live Prompt Preview β€” A dynamic indicator analyzing complexity and length constraints.
    • Curated Style Presets β€” Instantly apply preset community-curated styles.

πŸ€– AI Roleplay Chat

  • Contextual Character Lore β€” Engage with characters featuring extensive system prompts, narrative settings, and dating-sim mechanics.
  • Multi-Tier LLM Support β€” Switch dynamically between Fast, Balanced, and Ultra intelligence tiers.
  • Real-Time Sentiment Analysis β€” An emotional state engine analyzes the character's narrative output to automatically update their visual facial expression.
  • Dynamic User Profiles β€” Customize username, age, and gender preferences; the system dynamically adapts the AI character's tone, memory boundaries, and response structures.
  • The Warden Guard β€” Built-in local content moderation with adjustable levels (Low / Medium / High).
  • Interface Settings β€” Fluid grid, list, and compact library views with full export/import utilities, including a dialogue Skip Button for rapid conversation pacing.

πŸ–ΌοΈ Professional Image Editor

  • AI Outpainting β€” Extrapolate and extend canvas borders outward, filling newly defined areas seamlessly.
  • 4K Upscaling β€” Enhances resolution using advanced super-resolution models.
  • AI Image Fusion β€” Harmonizes two distinct images utilizing blend percentages and targeted model adapters.
  • Advanced Processing Models β€” Segmented with speed/quality indicators: FAST (PixelFusion), BEST (NeuralFlow), and MAX (Synapse).
  • Gender Swap Tool πŸ”„ β€” Swap character features dynamically using cloud-based AI worker pipelines, supporting async polling and automatic result injection.
  • Non-Destructive Adjustments β€” Fine-tune levels for brightness, contrast, temperature, and saturation.
  • Markup & Annotations β€” Built-in canvas brushes, text tools, and filter presets with localized real-time search.

πŸ“– AI Stories (Thena Toons)

  • Distraction-Free Reading β€” Optimized vertical flow designed for webtoon layout consumption.
  • Chapter State Manager β€” Tracks current episode progression ("Ongoing" and "Completed") cached directly in IndexedDB.
  • Lazy Loading β€” High-resolution comic sequences load on viewport entry, preserving CPU/GPU resources.

πŸͺ™ Credits & Gifting Ecosystem

  • Live Balance Tracking β€” Interactive header widget displays your current token balance in real-time, pulsing on updates and warning on low credits.
  • Detailed Package Analytics β€” Detailed comparison modals comparing pricing rates (β‚Ί) and estimating usages across different paid AI models.
  • Connection Codes β€” Easily share your connection code to send and receive peer-to-peer gifts securely.
  • Safe Purchase Verification β€” Prevent accidental double orders with key verification checkboxes and quick API key copying features.

🎬 Cinematic Welcome & Spotlight Guide

  • Cinematic Intro β€” Eye-catching letter spinning title intro animation accompanied by 8-bit procedurally generated synthesizers.
  • Interactive Spotlight Tour β€” Step-by-step element highlight tours (19 interactive steps) teaching users how to use models, prompt magic wands, outpainting, and settings.
  • Smooth Transitions & Skip Options β€” Fully responsive overlay mask with quick skip actions, restart options in settings, and custom success audio/visual notifications.

πŸ“Š Performance & Optimization

  • System Stats HUD β€” A draggable, resizable performance overlay tracking estimated FPS, memory usage, and GPU render cycles.
  • Power Saver API β€” Intercepts tab state changes (visibility/idle) to suspend audio synthesis, pause heavy CSS animations, and lock wake states via the Wake Lock API.
  • DOM Virtualization β€” Chat messages are loaded efficiently to avoid memory bloat, keeping scrolling lag-free.

πŸ’Ύ Local-First Privacy

  • Local Database Storage β€” Powered by IndexedDB, ensuring all custom characters, generated images, favorites, and transcripts are kept offline on your device.
  • Privacy by Design β€” API keys and personal profile details are saved directly in LocalStorage without third-party transit.

πŸ”Œ Developer API Hub & Interactive Console

  • Comprehensive API Documentation (api.html) β€” Fully documented local API endpoints for image generation, model pricing, ETAs, chatbot character metadata, and credit sharing.
  • Interactive API Console β€” Test API requests directly from a built-in UI playground with real-time response rendering and JSON tree views.
  • Easy Code Integration β€” Ready-to-use client snippets in multiple programming languages.
  • Dedicated Navigation β€” Instant access to local documentation from the updated header menu and redirection prompts.

πŸ“‚ Codebase Architecture & File Structure

Here is a breakdown of the core script modules that orchestrate the platform:

Thena-Web/
β”œβ”€β”€ index.html                  # Semantic structural entrypoint and layout framework
β”œβ”€β”€ trailer.html                # Standalone cinematic trailer presentation layer
β”œβ”€β”€ api.html                  # Developer API documentation page & interactive playground
β”œβ”€β”€ manifest.json               # PWA configuration and mobile icons settings
β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ style.css               # Unified stylesheets, theme engines, and animations
β”‚   β”œβ”€β”€ welcome.css             # Cinematic welcome and interactive spotlight guide styles
β”‚   β”œβ”€β”€ trailer.css             # Video player container and cinematic intro styles
β”‚   β”œβ”€β”€ editor-search.css       # Photo editor localized search styles and layout rules
β”‚   β”œβ”€β”€ model-gallery.css       # Layout styles for the AI model browser card gallery
β”‚   └── prompt-preview.css      # CSS styles for visual prompt keyword analytics and overlays
└── scripts/
    β”œβ”€β”€ script.js               # Main application controller (Orchestrator & Image Gen)
    β”œβ”€β”€ elements.js             # CACHED DOM element registry for selector optimization
    β”œβ”€β”€ lang.js                 # Localization dictionaries and i18n translation engine
    β”œβ”€β”€ aiChat.js               # Chat framework, character database, and chat UI logic
    β”œβ”€β”€ chatMessages.js         # Chat bubble template builders and list render controls
    β”œβ”€β”€ chatImageDownloader.js  # Async downloader utility for media within chat bubbles
    β”œβ”€β”€ imageEditor.js          # Photo filters, Canvas API operations, and Outpaint/Fusion tools
    β”œβ”€β”€ aiStories.js            # Webtoon reader controller and episode sequence loader
    β”œβ”€β”€ modelGallery.js         # Interactive catalog showcasing different image checkpoints
    β”œβ”€β”€ loadAllModels.js        # Details and assets downloader for different synthesis models
    β”œβ”€β”€ favorites-backups.js    # Data export/import utility and IndexedDB backup management
    β”œβ”€β”€ powerSaver.js           # Idle detector, battery/wake lock state manager
    β”œβ”€β”€ visibilityOptimizer.js  # IntersectionObserver engine pausing off-screen animations
    β”œβ”€β”€ cpu.js                  # HUD diagnostics parser (FPS, CPU & RAM monitor)
    β”œβ”€β”€ promptPreview.js        # Visual prompt length and keyword density indicators
    β”œβ”€β”€ promptexpansion.js      # Prompt expansion engine ("Magic Wand" logic)
    β”œβ”€β”€ trailer.js              # Introduction trailer video controller
    β”œβ”€β”€ welcome.js              # Cinematic introduction and interactive user guide (tutorial)
    β”œβ”€β”€ credits.js              # Credits system integration (gifting, packages, balance check)
    β”œβ”€β”€ customSelect.js         # Styled custom dropdown selection elements controller
    └── sw.js                   # Service Worker cache controller for offline PWA usage

πŸ“Έ Screenshots

Main Interface Advanced Image Editor
Main Interface Image Editor
AI Roleplay Chat AI Stories (Webtoon Reader)
AI Chat AI Stories Webtoon Reader
Gallery & Filters AI Outpainting
Gallery AI Outpainting

Show More Screenshots (Click to Expand)
Cinematic Intro Model Showcase
Cinematic Intro Model Showcase
Chat β€” Opening Scene Chat β€” Story Conclusion
Chat Start Chat End
Advanced Settings App Switcher
Advanced Settings App Switcher
Prompt Preview Module Settings Panel
Prompt Preview Settings Panel
Gallery Statistics AI Model Browser
Gallery Stats AI Model Browser

πŸ› οΈ Installation & Usage

Thena runs entirely on the client side. No server configuration or database setup is required.

Method 1: Local Server (Highly Recommended)

Serving the application via a local HTTP server is required to bypass browser CORS limitations and enable advanced PWA offline caching.

  1. Clone the repository:
    git clone https://github.com/phaticusthiccy/Thena-Web.git
  2. Launch a server in the root folder:
    • Python: python -m http.server 8000
    • NodeJS: npx http-server -p 8000
    • VS Code: Install the Live Server extension and click "Go Live".
  3. Open http://localhost:8000 in your browser.

Method 2: Direct Execution

Simply download the directory and open index.html directly in your browser. Note: Some browser security models may limit IndexedDB access or service worker installs when run from file protocol (file:///).


πŸ”‘ Configuration & API Key

An API key is required to synthesize images:

  1. Open the application settings (gear icon βš™οΈ).
  2. Click "Get Your Free API Key" to open the associated generation provider bot.
  3. Paste the returned token into the API Key input.
  4. The key is securely cached inside the browser's LocalStorage and is only sent directly to model generation endpoints.

🧩 Tech Stack

Technology Implementation Scope
HTML5 Semantic structure, dynamic template injection, responsive structural components.
CSS3 Premium UI aesthetics, Glassmorphism styles, dark/light theme engines, performance-optimized animations.
JavaScript (ES6+) Native asynchronous flow, Canvas manipulations, modular scripts loader, IndexedDB orchestration.
IndexedDB High-capacity offline storage of images, history states, chat rooms, and custom metadata.
Web Audio API Real-time UI audio generation and sound spatialization.
Canvas API Real-time browser-side cropping, filtering, and scaling adjustments.
Service Workers Prefetching, network caching strategies, and standalone Progressive Web App (PWA) installation.

🀝 Contributing

Contributions to improve performance, add new feature modules, or refine styling are welcome:

  1. Fork the repository.
  2. Create your branch: git checkout -b feature/amazing-feature
  3. Commit your changes (using Conventional Commits): git commit -m 'feat: add amazing new feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request.

πŸ“ License

Distributed under the MIT License. See LICENSE for more information.


Developed with passion by @phaticusthiccy

Made with ❀️ and lots of β˜•


Star this repo

Releases

Packages

Used by

Contributors

Languages