Update src/App.jsx
Browse files- src/App.jsx +24 -1
src/App.jsx
CHANGED
|
@@ -32,6 +32,9 @@ const App = () => {
|
|
| 32 |
const [selectedVae, setSelectedVae] = useState("Default");
|
| 33 |
const [selectedUpscaler, setSelectedUpscaler] = useState("None");
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 35 |
const [steps, setSteps] = useState(30);
|
| 36 |
const [cfgScale, setCfgScale] = useState(7.0);
|
| 37 |
const [seed, setSeed] = useState(-1);
|
|
@@ -146,7 +149,9 @@ const App = () => {
|
|
| 146 |
else if (upscaleFactor > 1) upscalerValue = upscaleFactor.toString();
|
| 147 |
|
| 148 |
const payload = {
|
| 149 |
-
prompt, negative_prompt: negPrompt,
|
|
|
|
|
|
|
| 150 |
sampler_name: sampler, checkpoint: selectedCheckpoint, lora: selectedLora,
|
| 151 |
vae: selectedVae, upscaler: upscalerValue, upscale_strength: upscaleStrength
|
| 152 |
};
|
|
@@ -271,6 +276,24 @@ const App = () => {
|
|
| 271 |
|
| 272 |
{showAdvanced && (
|
| 273 |
<div className="p-4 border-t border-slate-800 bg-slate-950/30 space-y-4 animate-in slide-in-from-top-2">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
{/* Steps & CFG */}
|
| 275 |
<div className="space-y-3">
|
| 276 |
<div className="flex justify-between text-[10px] uppercase text-slate-500 font-bold"><span>Steps: {steps}</span><span>CFG: {cfgScale}</span></div>
|
|
|
|
| 32 |
const [selectedVae, setSelectedVae] = useState("Default");
|
| 33 |
const [selectedUpscaler, setSelectedUpscaler] = useState("None");
|
| 34 |
|
| 35 |
+
// Settings
|
| 36 |
+
const [width, setWidth] = useState(1024);
|
| 37 |
+
const [height, setHeight] = useState(1024);
|
| 38 |
const [steps, setSteps] = useState(30);
|
| 39 |
const [cfgScale, setCfgScale] = useState(7.0);
|
| 40 |
const [seed, setSeed] = useState(-1);
|
|
|
|
| 149 |
else if (upscaleFactor > 1) upscalerValue = upscaleFactor.toString();
|
| 150 |
|
| 151 |
const payload = {
|
| 152 |
+
prompt, negative_prompt: negPrompt,
|
| 153 |
+
width, height, // Gửi kích thước ảnh
|
| 154 |
+
steps, cfg_scale: cfgScale, seed,
|
| 155 |
sampler_name: sampler, checkpoint: selectedCheckpoint, lora: selectedLora,
|
| 156 |
vae: selectedVae, upscaler: upscalerValue, upscale_strength: upscaleStrength
|
| 157 |
};
|
|
|
|
| 276 |
|
| 277 |
{showAdvanced && (
|
| 278 |
<div className="p-4 border-t border-slate-800 bg-slate-950/30 space-y-4 animate-in slide-in-from-top-2">
|
| 279 |
+
{/* Size Sliders */}
|
| 280 |
+
<div className="grid grid-cols-2 gap-4">
|
| 281 |
+
<div>
|
| 282 |
+
<label className="text-[10px] uppercase text-slate-500 font-bold mb-1 block">Width: {width}px</label>
|
| 283 |
+
<input
|
| 284 |
+
type="range" min="512" max="1536" step="64" value={width} onChange={(e) => setWidth(Number(e.target.value))}
|
| 285 |
+
className="w-full h-1 bg-slate-700 rounded-lg appearance-none cursor-pointer accent-purple-500"
|
| 286 |
+
/>
|
| 287 |
+
</div>
|
| 288 |
+
<div>
|
| 289 |
+
<label className="text-[10px] uppercase text-slate-500 font-bold mb-1 block">Height: {height}px</label>
|
| 290 |
+
<input
|
| 291 |
+
type="range" min="512" max="1536" step="64" value={height} onChange={(e) => setHeight(Number(e.target.value))}
|
| 292 |
+
className="w-full h-1 bg-slate-700 rounded-lg appearance-none cursor-pointer accent-purple-500"
|
| 293 |
+
/>
|
| 294 |
+
</div>
|
| 295 |
+
</div>
|
| 296 |
+
|
| 297 |
{/* Steps & CFG */}
|
| 298 |
<div className="space-y-3">
|
| 299 |
<div className="flex justify-between text-[10px] uppercase text-slate-500 font-bold"><span>Steps: {steps}</span><span>CFG: {cfgScale}</span></div>
|