add highres to txt2img tab and request
This commit is contained in:
parent
4e481e4864
commit
4f41145792
|
@ -107,7 +107,7 @@ def run_txt2img_pipeline(
|
|||
loras,
|
||||
)
|
||||
|
||||
def highres(tile: Image.Image, dims):
|
||||
def highres_tile(tile: Image.Image, dims):
|
||||
tile = tile.resize((size.height, size.width))
|
||||
if params.lpw:
|
||||
logger.debug("using LPW pipeline for highres")
|
||||
|
@ -147,7 +147,7 @@ def run_txt2img_pipeline(
|
|||
image,
|
||||
size.height // highres.scale,
|
||||
highres.scale,
|
||||
[highres],
|
||||
[highres_tile],
|
||||
)
|
||||
|
||||
image = run_upscale_correction(
|
||||
|
|
|
@ -8,7 +8,7 @@ import { useStore } from 'zustand';
|
|||
import { ConfigContext, StateContext } from '../../state.js';
|
||||
import { NumericField } from '../input/NumericField.js';
|
||||
|
||||
export function UpscaleControl() {
|
||||
export function HighresControl() {
|
||||
const { params } = mustExist(useContext(ConfigContext));
|
||||
const state = mustExist(useContext(StateContext));
|
||||
const highres = useStore(state, (s) => s.highres);
|
||||
|
@ -31,11 +31,10 @@ export function UpscaleControl() {
|
|||
/>
|
||||
<NumericField
|
||||
label={t('parameter.highres.steps')}
|
||||
decimal
|
||||
disabled={highres.enabled === false}
|
||||
min={params.denoise.min}
|
||||
max={params.denoise.max}
|
||||
step={params.denoise.step}
|
||||
min={params.highresSteps.min}
|
||||
max={params.highresSteps.max}
|
||||
step={params.highresSteps.step}
|
||||
value={highres.highresSteps}
|
||||
onChange={(steps) => {
|
||||
setHighres({
|
||||
|
@ -46,9 +45,9 @@ export function UpscaleControl() {
|
|||
<NumericField
|
||||
label={t('parameter.highres.scale')}
|
||||
disabled={highres.enabled === false}
|
||||
min={params.scale.min}
|
||||
max={params.scale.max}
|
||||
step={params.scale.step}
|
||||
min={params.highresScale.min}
|
||||
max={params.highresScale.max}
|
||||
step={params.highresScale.step}
|
||||
value={highres.highresScale}
|
||||
onChange={(scale) => {
|
||||
setHighres({
|
||||
|
@ -58,10 +57,11 @@ export function UpscaleControl() {
|
|||
/>
|
||||
<NumericField
|
||||
label={t('parameter.highres.strength')}
|
||||
decimal
|
||||
disabled={highres.enabled === false}
|
||||
min={params.strength.min}
|
||||
max={params.strength.max}
|
||||
step={params.outscale.step}
|
||||
min={params.highresStrength.min}
|
||||
max={params.highresStrength.max}
|
||||
step={params.highresStrength.step}
|
||||
value={highres.highresStrength}
|
||||
onChange={(strength) => {
|
||||
setHighres({
|
||||
|
|
|
@ -7,6 +7,7 @@ import { useMutation, useQueryClient } from 'react-query';
|
|||
import { useStore } from 'zustand';
|
||||
|
||||
import { ClientContext, ConfigContext, StateContext } from '../../state.js';
|
||||
import { HighresControl } from '../control/HighresControl.js';
|
||||
import { ImageControl } from '../control/ImageControl.js';
|
||||
import { UpscaleControl } from '../control/UpscaleControl.js';
|
||||
import { NumericField } from '../input/NumericField.js';
|
||||
|
@ -15,8 +16,8 @@ export function Txt2Img() {
|
|||
const { params } = mustExist(useContext(ConfigContext));
|
||||
|
||||
async function generateImage() {
|
||||
const { model, txt2img, upscale } = state.getState();
|
||||
const { image, retry } = await client.txt2img(model, txt2img, upscale);
|
||||
const { model, txt2img, upscale, highres } = state.getState();
|
||||
const { image, retry } = await client.txt2img(model, txt2img, upscale, highres);
|
||||
|
||||
pushHistory(image, retry);
|
||||
}
|
||||
|
@ -65,6 +66,7 @@ export function Txt2Img() {
|
|||
}}
|
||||
/>
|
||||
</Stack>
|
||||
<HighresControl />
|
||||
<UpscaleControl />
|
||||
<Button
|
||||
variant='contained'
|
||||
|
|
Loading…
Reference in New Issue