/** * MetadataPanel.js * Generates metadata panels for showcase media items */ /** * Generate metadata panel HTML * @param {boolean} hasParams - Whether there are generation parameters * @param {boolean} hasPrompts - Whether there are prompts * @param {string} prompt - Prompt text * @param {string} negativePrompt - Negative prompt text * @param {string} size - Image size * @param {string} seed - Generation seed * @param {string} model - Model used * @param {string} steps - Steps used * @param {string} sampler - Sampler used * @param {string} cfgScale - CFG scale * @param {string} clipSkip - Clip skip value * @returns {string} HTML content */ export function generateMetadataPanel(hasParams, hasPrompts, prompt, negativePrompt, size, seed, model, steps, sampler, cfgScale, clipSkip) { // Create unique IDs for prompt copying const promptIndex = Math.random().toString(36).substring(2, 15); const negPromptIndex = Math.random().toString(36).substring(2, 15); let content = '
'; if (hasParams) { content += `
${size ? `
Size:${size}
` : ''} ${seed ? `
Seed:${seed}
` : ''} ${model ? `
Model:${model}
` : ''} ${steps ? `
Steps:${steps}
` : ''} ${sampler ? `
Sampler:${sampler}
` : ''} ${cfgScale ? `
CFG:${cfgScale}
` : ''} ${clipSkip ? `
Clip Skip:${clipSkip}
` : ''}
`; } if (!hasParams && !hasPrompts) { content += ` `; } if (prompt) { content += ` `; } if (negativePrompt) { content += ` `; } content += '
'; return content; }