Pipeline
- Docsusage, props, keywords
- Demosrc/demo.tsx
- Buildshadcn add → vite
- Capturelight, dark, motion
- IndexBM25 + vectors
Public log. Prompts, raw model errors and costs stay on the admin side.
Log
Demo source
src/demo.tsx · from an earlier run
import { useAiAvatar } from '@/components/elements/use-ai-avatar'import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'import { Input } from '@/components/ui/input'import { Label } from '@/components/ui/label'export default function AiAvatarDemo() { const { generateAvatar, isGenerating, progress, status, error, avatarUrl } = useAiAvatar({ style: 'pixel-art' }) return ( <Card className='w-full max-w-sm'> <CardHeader> <CardTitle>Create your avatar</CardTitle> <CardDescription>Upload a photo to generate a pixel-art avatar.</CardDescription> </CardHeader> <CardContent className='grid gap-4'> <Avatar className='size-16'> <AvatarImage src={avatarUrl ?? undefined} alt='Generated AI avatar' /> <AvatarFallback>AI</AvatarFallback> </Avatar> <div className='grid gap-2'> <Label htmlFor='photo'>Photo</Label> <Input id='photo' type='file' accept='image/*' disabled={isGenerating} onChange={(e) => { const file = e.target.files?.[0] if (file) void generateAvatar({ image: file }) }} /> </div> {status && <p aria-live='polite' className='text-muted-foreground text-sm'>{status}</p>} {isGenerating && <progress className='w-full' value={progress} max={100} />} {error && <p role='alert' className='text-destructive text-sm'>{error.message}</p>} </CardContent> </Card> )}