Skip to content

Commit 54693c0

Browse files
authored
Merge pull request #27 from emykarma/main
fix: restore all generation params on Reuse Prompt
2 parents 1920297 + 18f896a commit 54693c0

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

components/CreatePanel.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,30 @@ export const CreatePanel: React.FC<CreatePanelProps> = ({
549549
setStyle(initialData.song.style);
550550
setTitle(initialData.song.title);
551551
setInstrumental(initialData.song.lyrics.length === 0);
552+
553+
const p = initialData.song.generationParams;
554+
if (p) {
555+
if (p.bpm !== undefined) setBpm(p.bpm);
556+
if (p.guidanceScale !== undefined) setGuidanceScale(p.guidanceScale);
557+
if (p.inferenceSteps !== undefined) setInferenceSteps(p.inferenceSteps);
558+
if (p.inferMethod !== undefined) setInferMethod(p.inferMethod);
559+
if (p.shift !== undefined) setShift(p.shift);
560+
if (p.seed !== undefined) setSeed(p.seed);
561+
if (p.randomSeed !== undefined) setRandomSeed(p.randomSeed);
562+
if (p.duration !== undefined) setDuration(p.duration);
563+
if (p.keyScale !== undefined) setKeyScale(p.keyScale);
564+
if (p.timeSignature !== undefined) setTimeSignature(p.timeSignature);
565+
if (p.vocalLanguage !== undefined) setVocalLanguage(p.vocalLanguage);
566+
if (p.batchSize !== undefined) setBatchSize(p.batchSize);
567+
if (p.audioFormat !== undefined) setAudioFormat(p.audioFormat);
568+
if (p.lmTemperature !== undefined) setLmTemperature(p.lmTemperature);
569+
if (p.lmCfgScale !== undefined) setLmCfgScale(p.lmCfgScale);
570+
if (p.lmTopK !== undefined) setLmTopK(p.lmTopK);
571+
if (p.lmTopP !== undefined) setLmTopP(p.lmTopP);
572+
if (p.lmNegativePrompt !== undefined) setLmNegativePrompt(p.lmNegativePrompt);
573+
if (p.lmBackend !== undefined) setLmBackend(p.lmBackend);
574+
if (p.lmModel !== undefined) setLmModel(p.lmModel);
575+
}
552576
}
553577
}, [initialData]);
554578

0 commit comments

Comments
 (0)