mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-01-02 12:29:11 +01:00
sampler fix
This commit is contained in:
parent
0d13fe67b0
commit
319f08c4c9
@ -43,6 +43,7 @@
|
|||||||
"how-many": "How many at once:",
|
"how-many": "How many at once:",
|
||||||
"width": "Width:",
|
"width": "Width:",
|
||||||
"height": "Height:",
|
"height": "Height:",
|
||||||
|
"sampler": "Sampler:",
|
||||||
"steps": "Number of inference steps:",
|
"steps": "Number of inference steps:",
|
||||||
"guide-scale": "Guidance Scale:",
|
"guide-scale": "Guidance Scale:",
|
||||||
"prompt-str": "Prompt Strength:",
|
"prompt-str": "Prompt Strength:",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from "react";
|
import React from "react";
|
||||||
import { useImageCreate } from "../../../../../stores/imageCreateStore";
|
import { useImageCreate, SAMPLER_OPTIONS } from "../../../../../stores/imageCreateStore";
|
||||||
import { useCreateUI } from "../../creationPanelUIStore";
|
import { useCreateUI } from "../../creationPanelUIStore";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -61,6 +61,10 @@ export default function PropertySettings() {
|
|||||||
state.getValueForRequestKey("height")
|
state.getValueForRequestKey("height")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const sampler = useImageCreate((state) =>
|
||||||
|
state.getValueForRequestKey("sampler")
|
||||||
|
);
|
||||||
|
|
||||||
const propertyOpen = useCreateUI((state) => state.isOpenAdvPropertySettings);
|
const propertyOpen = useCreateUI((state) => state.isOpenAdvPropertySettings);
|
||||||
const togglePropertyOpen = useCreateUI(
|
const togglePropertyOpen = useCreateUI(
|
||||||
(state) => state.toggleAdvPropertySettings
|
(state) => state.toggleAdvPropertySettings
|
||||||
@ -178,6 +182,22 @@ export default function PropertySettings() {
|
|||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className={SettingItem}>
|
||||||
|
<label>
|
||||||
|
{t("settings.sampler")}
|
||||||
|
<select
|
||||||
|
value={sampler}
|
||||||
|
onChange={(e) => setRequestOption("sampler", e.target.value)}
|
||||||
|
>
|
||||||
|
{SAMPLER_OPTIONS.map((sampler) => (
|
||||||
|
<option key={`sampler-option_${sampler}`} value={sampler}>
|
||||||
|
{sampler}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,6 +10,17 @@ export interface ImageCreationUiOptions {
|
|||||||
isSoundEnabled: boolean;
|
isSoundEnabled: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const SAMPLER_OPTIONS = [
|
||||||
|
'plms',
|
||||||
|
'ddim',
|
||||||
|
'heun',
|
||||||
|
'euler',
|
||||||
|
'euler_a',
|
||||||
|
'dpm2',
|
||||||
|
'dpm2_a',
|
||||||
|
'lms',
|
||||||
|
] as const;
|
||||||
|
|
||||||
export interface ImageRequest {
|
export interface ImageRequest {
|
||||||
prompt: string;
|
prompt: string;
|
||||||
seed: number;
|
seed: number;
|
||||||
@ -17,37 +28,37 @@ export interface ImageRequest {
|
|||||||
num_inference_steps: number;
|
num_inference_steps: number;
|
||||||
guidance_scale: number;
|
guidance_scale: number;
|
||||||
width:
|
width:
|
||||||
| 128
|
| 128
|
||||||
| 192
|
| 192
|
||||||
| 256
|
| 256
|
||||||
| 320
|
| 320
|
||||||
| 384
|
| 384
|
||||||
| 448
|
| 448
|
||||||
| 512
|
| 512
|
||||||
| 576
|
| 576
|
||||||
| 640
|
| 640
|
||||||
| 704
|
| 704
|
||||||
| 768
|
| 768
|
||||||
| 832
|
| 832
|
||||||
| 896
|
| 896
|
||||||
| 960
|
| 960
|
||||||
| 1024;
|
| 1024;
|
||||||
height:
|
height:
|
||||||
| 128
|
| 128
|
||||||
| 192
|
| 192
|
||||||
| 256
|
| 256
|
||||||
| 320
|
| 320
|
||||||
| 384
|
| 384
|
||||||
| 448
|
| 448
|
||||||
| 512
|
| 512
|
||||||
| 576
|
| 576
|
||||||
| 640
|
| 640
|
||||||
| 704
|
| 704
|
||||||
| 768
|
| 768
|
||||||
| 832
|
| 832
|
||||||
| 896
|
| 896
|
||||||
| 960
|
| 960
|
||||||
| 1024;
|
| 1024;
|
||||||
// allow_nsfw: boolean
|
// allow_nsfw: boolean
|
||||||
turbo: boolean;
|
turbo: boolean;
|
||||||
use_cpu: boolean;
|
use_cpu: boolean;
|
||||||
@ -58,6 +69,7 @@ export interface ImageRequest {
|
|||||||
show_only_filtered_image: boolean;
|
show_only_filtered_image: boolean;
|
||||||
init_image: undefined | string;
|
init_image: undefined | string;
|
||||||
prompt_strength: undefined | number;
|
prompt_strength: undefined | number;
|
||||||
|
sampler: typeof SAMPLER_OPTIONS[number];
|
||||||
}
|
}
|
||||||
|
|
||||||
type ModifiersList = string[];
|
type ModifiersList = string[];
|
||||||
@ -121,6 +133,7 @@ export const useImageCreate = create<ImageCreateState>(
|
|||||||
use_upscale: "RealESRGAN_x4plus",
|
use_upscale: "RealESRGAN_x4plus",
|
||||||
show_only_filtered_image: true,
|
show_only_filtered_image: true,
|
||||||
init_image: undefined,
|
init_image: undefined,
|
||||||
|
sampler: "plms",
|
||||||
},
|
},
|
||||||
|
|
||||||
// selected tags
|
// selected tags
|
||||||
@ -236,7 +249,7 @@ export const useImageCreate = create<ImageCreateState>(
|
|||||||
produce((state) => {
|
produce((state) => {
|
||||||
const isSeting =
|
const isSeting =
|
||||||
typeof state.getValueForRequestKey("use_face_correction") ===
|
typeof state.getValueForRequestKey("use_face_correction") ===
|
||||||
"string"
|
"string"
|
||||||
? null
|
? null
|
||||||
: "GFPGANv1.3";
|
: "GFPGANv1.3";
|
||||||
state.requestOptions.use_face_correction = isSeting;
|
state.requestOptions.use_face_correction = isSeting;
|
||||||
|
38
ui/frontend/dist/index.js
vendored
38
ui/frontend/dist/index.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user