diff --git a/components/PromptPanel.tsx b/components/PromptPanel.tsx index ee974ea..db760a2 100644 --- a/components/PromptPanel.tsx +++ b/components/PromptPanel.tsx @@ -1,7 +1,14 @@ -import { NextComponentType } from 'next' import PromptEntry from './PromptEntry' -const PromptPanel: NextComponentType = () => { +import { PromptInput } from "../types"; +interface PromptPanelProps { + prompts: PromptInput[]; + addPrompt: (prompt: string, seed: number) => void; +} + +const PromptPanel = (props: PromptPanelProps) => { + const prompts = props.prompts; + const addPrompt = props.addPrompt; return ( <> diff --git a/pages/index.tsx b/pages/index.tsx index 29ab9b5..3c9d86a 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,16 +1,24 @@ import Head from "next/head"; import { useState } from "react"; - import ThreeCanvas from "../components/ThreeCanvas"; import PromptPanel from "../components/PromptPanel"; -import Settings from '../components/Settings' -import Pause from '../components/Pause' +import Settings from "../components/Settings"; +import Pause from "../components/Pause"; + +import { InferenceResult, PromptInput } from "../types"; + +const defaultPromptInputs = [ + { prompt: "A jazz pianist playing a classical concerto", seed: 10 }, + { prompt: "Taylor Swift singing with a tropical beat", seed: 10 }, +]; export default function Home() { - const [paused, setPaused] = useState(false); + const [promptInputs, setPromptInputs] = + useState(defaultPromptInputs); + return ( <> @@ -27,12 +35,16 @@ export default function Home() { - + { + setPromptInputs([...promptInputs, { prompt: prompt, seed: seed }]); + }} + /> - ); diff --git a/types.ts b/types.ts new file mode 100644 index 0000000..eb1755e --- /dev/null +++ b/types.ts @@ -0,0 +1,25 @@ +export interface PromptInput { + prompt: string; + seed: number; + denoising?: number; + guidance?: number; +} + +export interface InferenceInput { + alpha: number; + // num_inference_steps: number; + // seed_image_id: number; + + start: PromptInput; + end: PromptInput; +} + +export interface InferenceResult { + input: InferenceInput; + + // URL of the image + image: string; + + // URL of the audio + audio: string; +}