Spaces:
Running
Running
File size: 4,740 Bytes
e2b45e2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | <!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> |