Clean build
This commit is contained in:
parent
5cf6c476ab
commit
e51c7d3129
|
@ -132,6 +132,7 @@ export default function AudioPlayer({
|
|||
resultCounter,
|
||||
inferenceResults,
|
||||
paused,
|
||||
nowPlayingCallback,
|
||||
tonePlayer,
|
||||
]);
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { useRouter } from "next/router";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useInterval } from "usehooks-ts";
|
||||
|
||||
import {
|
||||
AppState,
|
||||
|
@ -18,7 +17,6 @@ interface ModelInferenceProps {
|
|||
appState: AppState;
|
||||
promptInputs: PromptInput[];
|
||||
nowPlayingResult: InferenceResult;
|
||||
paused: boolean;
|
||||
newResultCallback: (input: InferenceInput, result: InferenceResult) => void;
|
||||
}
|
||||
|
||||
|
@ -33,7 +31,6 @@ export default function ModelInference({
|
|||
appState,
|
||||
promptInputs,
|
||||
nowPlayingResult,
|
||||
paused,
|
||||
newResultCallback,
|
||||
}: ModelInferenceProps) {
|
||||
// Create parameters for the inference request
|
||||
|
@ -142,10 +139,12 @@ export default function ModelInference({
|
|||
numInferenceSteps,
|
||||
seedImageId,
|
||||
newResultCallback,
|
||||
numRequestsMade,
|
||||
numResponsesReceived,
|
||||
]
|
||||
);
|
||||
|
||||
// Kick off the first inference run when everything is ready.
|
||||
// Kick off inference requests
|
||||
useEffect(() => {
|
||||
// Make sure things are initialized properly
|
||||
if (
|
||||
|
@ -157,8 +156,10 @@ export default function ModelInference({
|
|||
}
|
||||
|
||||
if (numRequestsMade == 0) {
|
||||
// Kick off the first request
|
||||
runInference(alpha, seed, appState, promptInputs);
|
||||
} else if (numRequestsMade == numResponsesReceived) {
|
||||
// Otherwise buffer ahead a few from where the audio player currently is
|
||||
// TODO(hayk): Replace this with better buffer management
|
||||
|
||||
const nowPlayingCounter = nowPlayingResult ? nowPlayingResult.counter : 0;
|
||||
|
@ -170,12 +171,13 @@ export default function ModelInference({
|
|||
}
|
||||
}, [
|
||||
initializedUrlParams,
|
||||
numRequestsMade,
|
||||
alpha,
|
||||
seed,
|
||||
appState,
|
||||
promptInputs,
|
||||
paused,
|
||||
nowPlayingResult,
|
||||
numRequestsMade,
|
||||
numResponsesReceived,
|
||||
runInference,
|
||||
]);
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import Head from "next/head";
|
||||
|
||||
export default function PageHead() {
|
||||
return (
|
||||
<Head>
|
||||
<title>Riffusion</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="My name is Riffusion, and I write music."
|
||||
/>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
);
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect, useState } from "react";
|
||||
import * as Tone from "tone";
|
||||
|
||||
import AudioPlayer from "../components/AudioPlayer";
|
||||
import PageHead from "../components/PageHead";
|
||||
import Info from "../components/Info";
|
||||
import ModelInference from "../components/ModelInference";
|
||||
import Pause from "../components/Pause";
|
||||
|
@ -156,14 +156,7 @@ export default function Home() {
|
|||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Riffusion</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="My name is Riffusion, and I write music."
|
||||
/>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
<PageHead />
|
||||
|
||||
<div className="bg-[#0A2342] flex flex-row min-h-screen text-white">
|
||||
<div className="w-1/3 min-h-screen">
|
||||
|
@ -179,7 +172,6 @@ export default function Home() {
|
|||
seed={seed}
|
||||
appState={appState}
|
||||
promptInputs={promptInputs}
|
||||
paused={paused}
|
||||
nowPlayingResult={nowPlayingResult}
|
||||
newResultCallback={newResultCallback}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue