Git Product home page Git Product logo

luma-api's Introduction

Luma API

中文

Using Golang, convert the video capabilities of the LumaAI Dream Machine into an API format for calls, making it easier to integrate quickly into third-party systems.

Disclaimer

  • This project is released on GitHub under the MIT license, free and open-source for educational purposes.

Good news

I provide the Luma AI API, no deployment is required, no subscription to Luma is required. Lower price, more convenient to use the Luma API.

Supported Features

  • Luma API supports video generation and allows uploading reference images.
  • Users can upload reference images in advance or provide third-party image links or base64 encoded images when submitting video tasks.
  • API interface security verification.
  • Simplified deployment process, supporting both docker-compose and docker.
  • Provides standardized services compatible with OpenAI's interface format, supporting both streaming and non-streaming output.
  • Supports customization of the OpenAI Chat response format based on Go Template syntax.
  • Compatible with frontend projects like chat-next-web.
  • Automatic keep-alive (max keep-alive 7 days).
  • [] Adapts to intermediary projects like New API.
  • [] Pre-detection of sensitive words.

Supported Endpoints

Video generation, supports uploading two images (start and end). [x] /generations Video extension, extends by 5 seconds each time. [x] /generations/:task_id/extend Query single video task. [x] /generations/:task_id Pre-upload images. [x] /generations/file_upload Get download URL without watermark. [x] /generations/:task_id/download_video_url Get account subscription information (balance, etc.). [x] /subscription/usage Get account information. [x] /users/me

Web UI

https://github.com/Dooy/chatgpt-web-midjourney-proxy
Online
https://api-chat.gptbest.vip

API Docs

http://localhost:8000/swagger/index.html

Request example

curl --location 'http://localhost:8000/luma/generations/' \
--header 'Authorization: Bearer {SECRET_TOKEN}' \
--header 'Content-Type: application/json' \
--data '{
    "user_prompt": "Increase dynamic",
    "aspect_ratio": "16:9",
    "expand_prompt": true,
    "image_url": "https://api.bltcy.ai/logo.png" 
}'

Response example

{
    "created_at": "2024-06-18T14:47:43.318498Z",
    "estimate_wait_seconds": null,
    "id": "a4a8f1ff-e59b-4969-abcb-98b3e16f003e",
    "liked": null,
    "prompt": "Increase dynamic",
    "state": "pending",
    "video": null
}

Deployment

Configuration

Log in using Google Chrome https://lumalabs.ai/dream-machine/ Get cookie cookie

Env Environment Variables

env description default value
COOKIE Cookie obtained from the image above for the Luma account None
BASE_URL Request API URL for Luma https://internal-api.virginia.labs.lumalabs.ai
PROXY HTTP proxy None
PORT Port 8000
SECRET_TOKEN Luma API seurity http header Bearer token None
ROTATE_LOGS Whether to rotate logs daily Yes
LOG_DIR Log output path ./logs
DEBUG Whether to enable Debug logging No
PPROF Whether to enable Pprof performance analysis, uses port 8005 if enabled No
CHAT_TIME_OUT Chat request time out 600 s
CHAT_TEMPLATE_DIR Chat template path ./template

Docker Deployment

Step-by-step guide on how to run a Docker container with specific environment variables and port mappings. Sensitive details like SQL names, passwords, and IP addresses are replaced with placeholders for this guide.

docker run --name luma-api -d -p 8000:8000 \
-e COOKIE=xxxx  \
 lumaapi/luma-api

docker-compose deployment

docker-compose pull && docker-compose up -d

docker-compose.yml

version: '3.2'

services:
  sunoapi:
    image: lumaapi/luma-api:latest
    container_name: luma-api
    restart: always
    ports:
      - "8000:8000"
    volumes:
      - ./logs:/logs
    environment:
      - COOKIE=xxxx

Local Deployment

  • Golang 1.20+
git clone https://github.com/LumaAI-API/Luma-API.git
cd Luma-API
go mod tidy

License

MIT © Luma API

Buy Me a Coke

zanshangcode.jpg

This project is open-source on GitHub under the MIT license and is free of charge. If you find this project helpful, please give it a star and share it. Thank you for your support!

luma-api's People

Contributors

leask avatar lumaai-api avatar xiangyuanliu avatar xyfacai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

luma-api's Issues

关于cookie过期问题

问题描述
之前的cookie半个小时更新一次,只要在响应的时候拿到最新的cookie,也就是luma_session,就可以保持账号的登录状态。但是这两天好像14个小时(不是准确值,估计值)后会自动掉线。cookie过期前,请求里也没有吐最新的cookie,不知道你们这边是否有发现了这种情况。
复现步骤

预期结果

生成失败

按照文档运行代码,并且按照md中的示例发起请求,也得到了示例响应,但是在luma官网看这个任务是“Generation Failed, please try again”

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.