v2.5.3 — Fix duplicate portrait + anti-repetition tags

- portraitAdded guard prevents duplicate image in chat
- Negative prompt: multiple views, split screen, repetition, duplicate
- Removed cowboy shot (caused repetition)
- Clean gender tags: 1girl, solo (no trailing comma)
- Steps 35, CFG 6.5 for better NoobAI-XL quality
- Image max-width 400px in chat
This commit is contained in:
arch_agent
2026-07-25 12:51:25 +02:00
parent 51e8036341
commit 4d0c915b2a
3 changed files with 16 additions and 14 deletions
+5 -3
View File
@@ -321,12 +321,14 @@
if (data.job_id) {
const jobId = data.job_id;
let portraitAdded = false; // Guard against duplicate insertion
const pollInterval = setInterval(async () => {
try {
const statusResp = await fetch(`/api/portrait/status/${jobId}`);
const statusData = await statusResp.json();
if (statusData.status === 'done' && statusData.image) {
if (statusData.status === 'done' && statusData.image && !portraitAdded) {
portraitAdded = true; // Prevent duplicate
clearInterval(pollInterval);
const imgUrl = `${statusData.image}?t=${Date.now()}`;
@@ -334,13 +336,13 @@
const avatarEl = document.querySelector('.avatar');
avatarEl.innerHTML = `<img src="${imgUrl}" style="width: 100%; height: 100%; border-radius: 50%; object-fit: cover;">`;
// Also show the portrait in the chat as a message
// Show portrait in chat as a message (only once!)
const portraitMsg = document.createElement('div');
portraitMsg.className = 'msg msg-bot';
portraitMsg.style.padding = '0';
portraitMsg.style.overflow = 'hidden';
portraitMsg.innerHTML = `
<img src="${imgUrl}" style="width: 100%; max-width: 300px; border-radius: 16px 16px 16px 4px; display: block;">
<img src="${imgUrl}" style="width: 100%; max-width: 400px; border-radius: 16px 16px 16px 4px; display: block;">
<div style="padding: 8px 12px; font-size: 0.8rem; color: var(--muted);">🖼️ Neues Portrait generiert</div>
`;
chat.appendChild(portraitMsg);