mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-17 15:15:17 +00:00
revert changes to UI
This commit is contained in:
1 parent
260172288a
commit
439309edb9
2 files changed
+3
-28
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { useRef, useState } from "react";
|
||||
import { useRef } from "react";
|
||||
import { JobContextType } from "@storyteller/common";
|
||||
import { PromptBoxImage } from "@storyteller/ui-promptbox";
|
||||
import BackgroundGallery from "./BackgroundGallery";
|
||||
@@ -27,13 +27,6 @@ const TextToImage = ({ imageMediaId, imageUrl }: TextToImageProps) => {
|
||||
const selectedModelInfo: ModelInfo | undefined =
|
||||
IMAGE_MODELS_BY_LABEL[selectedModel];
|
||||
|
||||
const [numberImages, setNumberImages] = useState(1);
|
||||
|
||||
const handleNumberImagesChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
const value = event.target.value;
|
||||
setNumberImages(parseInt(value));
|
||||
};
|
||||
|
||||
const jobContext: JobContextType = {
|
||||
jobTokens: [],
|
||||
addJobToken: () => {},
|
||||
@@ -53,14 +46,6 @@ const TextToImage = ({ imageMediaId, imageUrl }: TextToImageProps) => {
|
||||
<span className="pt-2 text-xl opacity-80">
|
||||
Add a prompt, then generate
|
||||
</span>
|
||||
|
||||
|
||||
<select onChange={handleNumberImagesChange} value={numberImages}>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<PromptBoxImage
|
||||
@@ -68,7 +53,6 @@ const TextToImage = ({ imageMediaId, imageUrl }: TextToImageProps) => {
|
||||
console.log("Using job context");
|
||||
return jobContext;
|
||||
}}
|
||||
numberImages={numberImages}
|
||||
model={selectedModel}
|
||||
modelInfo={selectedModelInfo}
|
||||
imageMediaId={imageMediaId}
|
||||
|
||||
@@ -8,7 +8,6 @@ import { Button, ToggleButton } from "@storyteller/ui-button";
|
||||
import { Modal } from "@storyteller/ui-modal";
|
||||
import {
|
||||
EnqueueTextToImage,
|
||||
EnqueueTextToImageRequest,
|
||||
EnqueueTextToImageSize,
|
||||
} from "@storyteller/tauri-api";
|
||||
import {
|
||||
@@ -38,7 +37,6 @@ interface PromptBoxImageProps {
|
||||
model: string;
|
||||
modelInfo?: ModelInfo;
|
||||
imageMediaId?: string;
|
||||
numberImages: number;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
@@ -48,7 +46,6 @@ export const PromptBoxImage = ({
|
||||
model,
|
||||
modelInfo,
|
||||
imageMediaId,
|
||||
numberImages,
|
||||
url,
|
||||
}: PromptBoxImageProps) => {
|
||||
useSignals();
|
||||
@@ -213,17 +210,11 @@ export const PromptBoxImage = ({
|
||||
|
||||
const aspectRatio = getCurrentAspectRatio();
|
||||
|
||||
let request : EnqueueTextToImageRequest = {
|
||||
const generateResponse = await EnqueueTextToImage({
|
||||
prompt: prompt,
|
||||
model: modelInfo,
|
||||
aspect_ratio: aspectRatio,
|
||||
};
|
||||
|
||||
if (numberImages >= 1 && numberImages <= 4) {
|
||||
request.number_images = numberImages;
|
||||
}
|
||||
|
||||
const generateResponse = await EnqueueTextToImage(request);
|
||||
});
|
||||
|
||||
console.log("PromptBoxImage - generateResponse", generateResponse);
|
||||
|
||||
|
||||
Reference in new issue
Block a user