Skip to content

Js examples#2

Open
sajjadkalantari wants to merge 11 commits intocomput3ai:mainfrom
sajjadkalantari:js-examples
Open

Js examples#2
sajjadkalantari wants to merge 11 commits intocomput3ai:mainfrom
sajjadkalantari:js-examples

Conversation

@sajjadkalantari
Copy link

Added React UI and Node.js Examples for Comput3 Platform Integration

This PR introduces new example applications demonstrating how to integrate with the Comput3 AI platform using both React and Node.js technologies.

React UI Example (005-react-samples)

C3 Render UI

A modern, full-featured React application for interacting with the C3 Render API:

  • Technology stack: React, TypeScript, TailwindCSS, Axios, React Router
  • Core features:
    • Multi-service integration (CSM text-to-speech, Whisper speech-to-text, Portrait generation, Image analysis)
    • Complete job management (submission, tracking, and result viewing)
    • Secure API key management through browser localStorage
    • Built-in API testing tool for debugging and request validation
    • Responsive design with modern UI components
  • Development features:
    • Environment configuration for different deployment scenarios
    • CORS handling through proxy configuration
    • Polling mechanism for real-time job status updates
    • Comprehensive error handling and user feedback

C3 Render API & Worker

The backend distributed system that powers the React UI:

  • Flask API server for job submission and management
  • Python worker for processing AI rendering tasks
  • Redis-based job queue with smart processing prioritization
  • S3-compatible storage integration using MinIO
  • Robust GPU instance management with health monitoring
  • Advanced job timing constraints and execution controls
  • Detailed API documentation with curl examples

Node.js Examples

ComfyUI Avatar Generator (002-comfyui-script-nodejs)

Node.js script for generating talking head avatars:

  • Takes portrait images and audio files as input
  • Produces animated videos of the portrait speaking the audio
  • Demonstrates media instance management on Comput3
  • Shows workflow templating and dynamic configuration with ComfyUI
  • Includes automatic image dimension and aspect ratio handling
  • Features audio analysis for duration detection

Prompt Script (003-prompt-script-nodejs)

Batch processing tool for language model prompts:

  • Sends multiple prompts from a text file to LLMs on Comput3
  • Demonstrates API authentication and proper request formatting
  • Saves responses to individual text files with organized output
  • Includes command-line argument parsing and environment configuration
  • Shows efficient handling of sequential API requests

Vision Model Analyzer (004-visionmodel-script-nodejs)

Image analysis tool using vision models:

  • Sends images to Comput3 vision models for AI-powered analysis
  • Demonstrates GPU instance detection and validation
  • Includes result formatting and file output management
  • Features a simple command-line interface
  • Shows proper error handling and user feedback

Benefits

  • Complete ecosystem: Examples cover both frontend and backend integration paths
  • Multiple modalities: Demonstrates language, speech, vision, and visual synthesis capabilities
  • Production-ready patterns: Shows authentication, error handling, and scalable architecture
  • Well-documented: Detailed READMEs with setup instructions and usage examples
  • Reusable components: Modular design with reusable API client modules
  • Best practices: Follows modern development practices and coding standards

These examples provide developers with everything needed to quickly start building applications with the Comput3 platform, whether creating user-facing web applications or backend processing systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant