53d2d2ffef
- Implemented admin dashboard with user management features including role assignment and deletion. - Added user profile page for updating email and password. - Created separate routes and templates for text, image, and video generation with appropriate forms. - Enhanced navigation with dropdown for generation options and loading overlay for better user experience. - Introduced comprehensive error handling and user feedback through alerts. - Updated styles for improved UI consistency and responsiveness. Co-authored-by: Copilot <copilot@github.com>
51 lines
2.1 KiB
HTML
51 lines
2.1 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Image Generation — AI Allucanget{% endblock %}
|
||
{% block content %}
|
||
<div class="card">
|
||
<h1>Image Generation</h1>
|
||
<form method="post">
|
||
<label for="model">Model</label>
|
||
<input id="model" name="model" type="text" required
|
||
placeholder="e.g. openai/dall-e-3"
|
||
value="{{ request.form.get('model', '') }}">
|
||
|
||
<label for="prompt">Prompt</label>
|
||
<textarea id="prompt" name="prompt" rows="4" required
|
||
placeholder="Describe the image you want…">{{ request.form.get('prompt', '') }}</textarea>
|
||
|
||
<label for="size">Size</label>
|
||
<select id="size" name="size">
|
||
<option value="1024x1024" {% if request.form.get('size','1024x1024')=='1024x1024' %}selected{% endif %}>1024×1024</option>
|
||
<option value="1792x1024" {% if request.form.get('size')=='1792x1024' %}selected{% endif %}>1792×1024 (landscape)</option>
|
||
<option value="1024x1792" {% if request.form.get('size')=='1024x1792' %}selected{% endif %}>1024×1792 (portrait)</option>
|
||
<option value="512x512" {% if request.form.get('size')=='512x512' %}selected{% endif %}>512×512</option>
|
||
</select>
|
||
|
||
<label for="n">Number of images</label>
|
||
<select id="n" name="n">
|
||
<option value="1" {% if request.form.get('n','1')=='1' %}selected{% endif %}>1</option>
|
||
<option value="2" {% if request.form.get('n')=='2' %}selected{% endif %}>2</option>
|
||
<option value="4" {% if request.form.get('n')=='4' %}selected{% endif %}>4</option>
|
||
</select>
|
||
|
||
<button type="submit">Generate image</button>
|
||
</form>
|
||
|
||
{% if error %}
|
||
<div class="alert alert-error mt-2">{{ error }}</div>
|
||
{% endif %}
|
||
|
||
{% if result %}
|
||
<div class="result">
|
||
<h2>Generated image{{ 's' if result.images|length > 1 }}</h2>
|
||
{% for img in result.images %}
|
||
<img src="{{ img.url }}" alt="Generated image" class="generated-image">
|
||
{% if img.revised_prompt %}
|
||
<p class="text-muted mt-1" style="font-size:0.8rem;">{{ img.revised_prompt }}</p>
|
||
{% endif %}
|
||
{% endfor %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endblock %}
|