Files
html/api/ltx-video-api.php
2026-04-12 22:57:03 +02:00

24 lines
1.0 KiB
PHP

<?php
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
$action = $_GET['action'] ?? $_POST['action'] ?? 'status';
if ($action === 'status') {
echo json_encode([
'ok'=>true,'service'=>'LTX-Video','provider'=>'Lightricks',
'gpu_required'=>true, 'local_gpu'=>false,
'alternatives'=>[
['name'=>'HF Spaces','url'=>'https://huggingface.co/spaces/Lightricks/LTX-Video','cost'=>'free'],
['name'=>'Colab','url'=>'https://colab.research.google.com','cost'=>'free GPU'],
['name'=>'Replicate','url'=>'https://replicate.com/lightricks/ltx-video','cost'=>'$0.03/video'],
],
'model'=>'ltx-video-2b-v0.9.5',
]);
} elseif ($action === 'generate') {
$p = $_POST['prompt'] ?? '';
echo json_encode([
'ok'=>false,'gpu_required'=>true,
'use_hf_spaces'=>'https://huggingface.co/spaces/Lightricks/LTX-Video?prompt='.urlencode($p),
'message'=>"Ouvrez HF Spaces pour generer la video (GPU gratuit)"
]);
}