fix: limit UNet stride to tile size
This commit is contained in:
parent
3b02fc5768
commit
e68e405633
|
@ -140,7 +140,7 @@ def pipeline_from_request(
|
|||
get_config_value("overlap", "max"),
|
||||
get_config_value("overlap", "min"),
|
||||
)
|
||||
stride = get_and_clamp_float(
|
||||
stride = get_and_clamp_int(
|
||||
request.args,
|
||||
"stride",
|
||||
get_config_value("stride"),
|
||||
|
@ -148,6 +148,10 @@ def pipeline_from_request(
|
|||
get_config_value("stride", "min"),
|
||||
)
|
||||
|
||||
if stride > tiles:
|
||||
logger.info("limiting stride to tile size, %s > %s", stride, tiles)
|
||||
stride = tiles
|
||||
|
||||
seed = int(request.args.get("seed", -1))
|
||||
if seed == -1:
|
||||
# this one can safely use np.random because it produces a single value
|
||||
|
|
|
@ -34,6 +34,9 @@ export function ImageControl(props: ImageControlProps) {
|
|||
staleTime: STALE_TIME,
|
||||
});
|
||||
|
||||
// max stride is the lesser of tile size and server's max stride
|
||||
const maxStride = Math.max(controlState.tiles, params.stride.max);
|
||||
|
||||
return <Stack spacing={2}>
|
||||
<Stack direction='row' spacing={4}>
|
||||
<QueryList
|
||||
|
@ -181,7 +184,7 @@ export function ImageControl(props: ImageControlProps) {
|
|||
<NumericField
|
||||
label={t('parameter.stride')}
|
||||
min={params.stride.min}
|
||||
max={params.stride.max}
|
||||
max={maxStride}
|
||||
step={params.stride.step}
|
||||
value={controlState.stride}
|
||||
onChange={(stride) => {
|
||||
|
|
|
@ -220,6 +220,7 @@ export function baseParamsFromServer(defaults: ServerParams): Required<BaseImgPa
|
|||
tiledVAE: defaults.tiledVAE.default,
|
||||
tiles: defaults.tiles.default,
|
||||
overlap: defaults.overlap.default,
|
||||
stride: defaults.stride.default,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue