Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions src/areas/generate/components/GenerationOptions.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from 'react'
import { useAppStore } from '@shared/stores/appStore'
import { FieldLabel, Tooltip } from '@shared/components/ui'
import { FieldLabel, Tooltip, ConfirmModal } from '@shared/components/ui'

import type { CatalogModel } from '../models'

Expand Down Expand Up @@ -161,6 +161,7 @@ export default function GenerationOptions(): JSX.Element {
)

const isDisabled = currentJob?.status === 'uploading' || currentJob?.status === 'generating'
const [showTextureWarning, setShowTextureWarning] = useState(false)

useEffect(() => {
window.electron.model.listDownloaded()
Expand All @@ -186,6 +187,7 @@ export default function GenerationOptions(): JSX.Element {
}

return (
<>
<div className={`flex flex-col px-4 pb-4 gap-3 ${isDisabled ? 'opacity-50 pointer-events-none' : ''}`}>
<div className="h-px bg-zinc-800" />
<h2 className="text-xs font-semibold uppercase tracking-widest text-zinc-500">Options</h2>
Expand Down Expand Up @@ -416,7 +418,13 @@ export default function GenerationOptions(): JSX.Element {
<button
role="checkbox"
aria-checked={generationOptions.enableTexture}
onClick={() => setGenerationOptions({ enableTexture: !generationOptions.enableTexture })}
onClick={() => {
if (!generationOptions.enableTexture) {
setShowTextureWarning(true)
} else {
setGenerationOptions({ enableTexture: false })
}
}}
className={`ml-2 w-9 h-5 rounded-full transition-colors relative flex-shrink-0 ${
generationOptions.enableTexture ? 'bg-accent' : 'bg-zinc-700'
}`}
Expand Down Expand Up @@ -466,5 +474,20 @@ export default function GenerationOptions(): JSX.Element {
</div>

</div>

{showTextureWarning && (
<ConfirmModal
title="Texture generation is experimental"
description="This feature is still in development and may produce unexpected results, crash, or significantly slow down generation. Use at your own risk."
confirmLabel="Enable anyway"
cancelLabel="Cancel"
onConfirm={() => {
setGenerationOptions({ enableTexture: true })
setShowTextureWarning(false)
}}
onCancel={() => setShowTextureWarning(false)}
/>
)}
</>
)
}
2 changes: 1 addition & 1 deletion src/shared/stores/appStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const DEFAULT_OPTIONS: GenerationOptions = {
modelId: 'sf3d',
vertexCount: 10000,
remesh: 'quad',
enableTexture: true,
enableTexture: false,
textureResolution: 512,
octreeResolution: 380,
guidanceScale: 5.5,
Expand Down