import React, { useEffect } from "react"; import { useImageCreate } from "../../../store/imageCreateStore"; import "./advancedSettings.css"; // todo: move this someplace more global const IMAGE_DIMENSIONS = [ { value: 128, label: "128 (*)" }, { value: 192, label: "192" }, { value: 256, label: "256 (*)" }, { value: 320, label: "320" }, { value: 384, label: "384" }, { value: 448, label: "448" }, { value: 512, label: "512 (*)" }, { value: 576, label: "576" }, { value: 640, label: "640" }, { value: 704, label: "704" }, { value: 768, label: "768 (*)" }, { value: 832, label: "832" }, { value: 896, label: "896" }, { value: 960, label: "960" }, { value: 1024, label: "1024 (*)" }, ]; function SettingsList() { const parallelCount = useImageCreate((state) => state.parallelCount); const setParallelCount = useImageCreate((state) => state.setParallelCount); const setRequestOption = useImageCreate((state) => state.setRequestOptions); const toggleUseFaceCorrection = useImageCreate( (state) => state.toggleUseFaceCorrection ); const isUsingFaceCorrection = useImageCreate((state) => state.isUsingFaceCorrection() ); const toggleUseUpscaling = useImageCreate( (state) => state.toggleUseUpscaling ); const isUsingUpscaling = useImageCreate((state) => state.isUsingUpscaling()); const toggleUseRandomSeed = useImageCreate( (state) => state.toggleUseRandomSeed ); const isRandomSeed = useImageCreate((state) => state.isRandomSeed()); const toggleUseAutoSave = useImageCreate((state) => state.toggleUseAutoSave); const isUseAutoSave = useImageCreate((state) => state.isUseAutoSave()); const toggleSoundEnabled = useImageCreate( (state) => state.toggleSoundEnabled ); const isSoundEnabled = useImageCreate((state) => state.isSoundEnabled()); const use_upscale = useImageCreate((state) => state.getValueForRequestKey("use_upscale") ); const show_only_filtered_image = useImageCreate((state) => state.getValueForRequestKey("show_only_filtered_image") ); const seed = useImageCreate((state) => state.getValueForRequestKey("seed")); const width = useImageCreate((state) => state.getValueForRequestKey("width")); const num_outputs = useImageCreate((state) => state.getValueForRequestKey("num_outputs") ); const height = useImageCreate((state) => state.getValueForRequestKey("height") ); const steps = useImageCreate((state) => state.getValueForRequestKey("num_inference_steps") ); const guidance_scale = useImageCreate((state) => state.getValueForRequestKey("guidance_scale") ); const prompt_strength = useImageCreate((state) => state.getValueForRequestKey("prompt_strength") ); const save_to_disk_path = useImageCreate((state) => state.getValueForRequestKey("save_to_disk_path") ); const turbo = useImageCreate((state) => state.getValueForRequestKey("turbo")); const use_cpu = useImageCreate((state) => state.getValueForRequestKey("use_cpu") ); const use_full_precision = useImageCreate((state) => state.getValueForRequestKey("use_full_precision") ); return ( ); } // {/* */} export default function AdvancedSettings() { const advancedSettingsIsOpen = useImageCreate( (state) => state.uiOptions.advancedSettingsIsOpen ); const toggleAdvancedSettingsIsOpen = useImageCreate( (state) => state.toggleAdvancedSettingsIsOpen ); return (
{advancedSettingsIsOpen && }
); }