Switch Hermes prompt workflow to plain-text Style/Lyrics paste blocks
This commit is contained in:
parent
f3d81832d5
commit
665a7e5655
1 changed files with 23 additions and 24 deletions
|
|
@ -53,12 +53,18 @@ pre{background:#111827;padding:.8rem;border-radius:.5rem;overflow:auto;white-spa
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<h2>1. Generate Suno Prompt</h2>
|
<h2>1. Generate Suno Prompt</h2>
|
||||||
<button type="button" onclick="copyPromptForHermes()">Copy customer info for Hermes</button>
|
<button type="button" onclick="copyPromptForHermes()">Copy customer info for Hermes</button>
|
||||||
<p class="copy-hint">Paste the result from Hermes into the box below, then click Apply to fill Style and Lyrics.</p>
|
<p class="copy-hint">Paste the Style block and Lyrics block from Hermes into the boxes below, then click Apply.</p>
|
||||||
<label for="hermes_json">Paste Hermes JSON result here</label>
|
|
||||||
<textarea id="hermes_json" rows="6" placeholder='{"title": "...", "style": "...", "lyrics": "..."}'></textarea>
|
<label for="pasted_style">Paste Style block here</label>
|
||||||
|
<textarea id="pasted_style" rows="6" placeholder="Everything under 'Style:'"></textarea>
|
||||||
|
|
||||||
|
<label for="pasted_lyrics">Paste Lyrics block here</label>
|
||||||
|
<textarea id="pasted_lyrics" rows="10" placeholder="Everything under 'Lyrics:'"></textarea>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button type="button" class="secondary" onclick="applyHermesJson()">Apply JSON to fields</button>
|
<button type="button" class="secondary" onclick="applyPastedBlocks()">Apply to fields</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
<input type="hidden" name="action" value="save_prompt">
|
<input type="hidden" name="action" value="save_prompt">
|
||||||
<label for="suno_style">Suno Style</label>
|
<label for="suno_style">Suno Style</label>
|
||||||
|
|
@ -121,31 +127,24 @@ function copyPromptForHermes() {
|
||||||
style_genre: {{ req.style_genre | tojson }},
|
style_genre: {{ req.style_genre | tojson }},
|
||||||
extra_requests: {{ req.extra_requests | tojson }}
|
extra_requests: {{ req.extra_requests | tojson }}
|
||||||
};
|
};
|
||||||
const text = "Please write a Suno Custom Mode prompt for this customer. Return ONLY a JSON object with keys: title, style, lyrics.\n\nCustomer data:\n" + JSON.stringify(data, null, 2);
|
const text = `Please write a Suno Custom Mode prompt for this customer.\n\nCustomer data:\nName: ${data.name}\nHobbies: ${data.hobbies || '-'}\nNotable facts: ${data.notable_facts || '-'}\nStyle / genre: ${data.style_genre || '-'}\nExtra requests: ${data.extra_requests || '-'}\n\nReply with exactly this format (no JSON):\n\nStyle:\n[the style description here]\n\nLyrics:\n[the lyrics here, with metatags]`;
|
||||||
navigator.clipboard.writeText(text).then(() => alert("Copied! Paste into Hermes, then paste Hermes JSON result into the box above and click Apply."));
|
navigator.clipboard.writeText(text).then(() => alert("Copied! Paste Hermes response into the Style and Lyrics boxes, then click Apply."));
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyHermesJson() {
|
function applyPastedBlocks() {
|
||||||
const raw = document.getElementById('hermes_json').value.trim();
|
const styleBlock = document.getElementById('pasted_style').value.trim();
|
||||||
if (!raw) {
|
const lyricsBlock = document.getElementById('pasted_lyrics').value.trim();
|
||||||
alert("Paste Hermes JSON first.");
|
if (!styleBlock && !lyricsBlock) {
|
||||||
|
alert("Paste Style and/or Lyrics first.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
if (styleBlock) {
|
||||||
const parsed = JSON.parse(raw);
|
document.getElementById('suno_style').value = styleBlock;
|
||||||
if (parsed.style) {
|
|
||||||
document.getElementById('suno_style').value = parsed.style;
|
|
||||||
}
|
|
||||||
if (parsed.lyrics) {
|
|
||||||
document.getElementById('suno_lyrics').value = parsed.lyrics;
|
|
||||||
}
|
|
||||||
const msg = [];
|
|
||||||
if (parsed.title) msg.push('Title: ' + parsed.title);
|
|
||||||
msg.push('Style and lyrics applied.');
|
|
||||||
alert(msg.join('\n'));
|
|
||||||
} catch (e) {
|
|
||||||
alert("Invalid JSON: " + e.message);
|
|
||||||
}
|
}
|
||||||
|
if (lyricsBlock) {
|
||||||
|
document.getElementById('suno_lyrics').value = lyricsBlock;
|
||||||
|
}
|
||||||
|
alert("Style and lyrics applied.");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Reference in a new issue