artforge-ai-studio / api-docs.html
Gawker97's picture
the Images will be sent over to the backend and be sent over JSON format to a gpu , the gpu sends back a picture that is then put to the output, so we need a get, set, api set up
e2b45e2 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Documentation - ArtForge AI Studio</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
.gradient-bg {
background: linear-gradient(135deg, #6b21a8 0%, #7c3aed 50%, #4f46e5 100%);
}
.code-block {
background-color: #2d2d2d;
color: #f8f8f2;
padding: 1rem;
border-radius: 0.5rem;
font-family: monospace;
overflow-x: auto;
}
</style>
</head>
<body class="bg-gray-100">
<div class="min-h-screen">
<header class="gradient-bg text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-2">
<i data-feather="code" class="w-8 h-8"></i>
<h1 class="text-2xl font-bold">ArtForge API Documentation</h1>
</div>
<nav>
<ul class="flex space-x-6">
<li><a href="index.html" class="hover:text-purple-200 transition">Studio</a></li>
</ul>
</nav>
</div>
</div>
</header>
<main class="container mx-auto px-4 py-8">
<div class="bg-white rounded-xl shadow-md p-8 space-y-8">
<section>
<h2 class="text-xl font-semibold mb-4">API Endpoints</h2>
<div class="space-y-6">
<div>
<h3 class="font-medium text-lg mb-2">POST /api/generate</h3>
<p class="text-gray-600 mb-3">Generate artwork based on provided parameters and images.</p>
<div class="code-block mb-4">
<pre>Request:
{
"params": {
"denoise_low": 0.5,
"denoise_high": 0.85,
"batch_size": 4,
"guidance": 7.5,
"style_guidance": 0.8,
"control_guidance": 0.5,
"steps": 20,
"seed": 42,
"prompt": "a beautiful landscape"
},
"input_image": "Base64 encoded image (optional)",
"control_image": "Base64 encoded image (optional)",
"style_image": "Base64 encoded image (optional)"
}
Response:
{
"status": "success",
"image_url": "https://storage.example.com/generated/abc123.png",
"generation_id": "abc123",
"metadata": {
"time_taken": 4.23,
"gpu": "A100"
}
}</pre>
</div>
</div>
<div>
<h3 class="font-medium text-lg mb-2">GET /api/history</h3>
<p class="text-gray-600 mb-3">Retrieve generation history.</p>
<div class="code-block mb-4">
<pre>Response:
[
{
"id": "abc123",
"thumbnail_url": "https://storage.example.com/thumbnails/abc123.jpg",
"prompt": "a beautiful landscape",
"created_at": "2023-07-15T12:34:56Z"
},
...
]</pre>
</div>
</div>
<div>
<h3 class="font-medium text-lg mb-2">GET /api/history/:id</h3>
<p class="text-gray-600 mb-3">Get details of a specific generation.</p>
<div class="code-block mb-4">
<pre>Response:
{
"id": "abc123",
"image_url": "https://storage.example.com/generated/abc123.png",
"prompt": "a beautiful landscape",
"params": {
"denoise_low": 0.5,
"denoise_high": 0.85,
"steps": 20,
"seed": 42
},
"created_at": "2023-07-15T12:34:56Z"
}</pre>
</div>
</div>
</div>
</section>
<section>
<h2 class="text-xl font-semibold mb-4">Error Responses</h2>
<div class="code-block">
<pre>{
"status": "error",
"code": 400,
"message": "Invalid parameters provided",
"details": {
"denoise_low": "Must be between 0 and 1"
}
}</pre>
</div>
</section>
</div>
</main>
</div>
<script>
feather.replace();
</script>
</body>
</html>