import{isEmpty,deepClone}from"../../base/helpers.mjs";import{FormView}from"../base.mjs";import{FormInputView,NumberInputView,SelectInputView,CheckboxInputView,MaskTypeInputView,SchedulerInputView,RepeatableInputView,NoiseOffsetInputView,NoiseMethodInputView,BlendMethodInputView,UpscaleAmountInputView,UpscaleMethodInputView,UpscaleDiffusionStepsInputView,UpscaleDiffusionPromptInputView,UpscaleDiffusionStrengthInputView,UpscaleDiffusionPipelineInputView,UpscaleDiffusionControlnetInputView,UpscaleDiffusionGuidanceScaleInputView,UpscaleDiffusionNegativePromptInputView}from"../input.mjs";class UpscaleFormView extends FormView{static fieldSets={"Upscaling Step":{amount:{label:"Upscale Amount",class:UpscaleAmountInputView},method:{label:"Upscale Method",class:UpscaleMethodInputView},strength:{label:"Denoising Strength",class:UpscaleDiffusionStrengthInputView},pipeline:{label:"Pipeline",class:UpscaleDiffusionPipelineInputView},controlnet:{label:"ControlNet",class:UpscaleDiffusionControlnetInputView},controlnetScale:{label:"ControlNet Scale",class:NumberInputView,config:{value:1,min:0,step:.01,tooltip:"This has no effect if no controlnet is selected."}},prompt:{label:"Detail Prompt",class:UpscaleDiffusionPromptInputView},negativePrompt:{label:"Detail Negative Prompt",class:UpscaleDiffusionNegativePromptInputView},scheduler:{label:"Scheduler",class:SchedulerInputView},inferenceSteps:{label:"Inference Steps",class:UpscaleDiffusionStepsInputView},guidanceScale:{label:"Guidance Scale",class:UpscaleDiffusionGuidanceScaleInputView},tilingStride:{label:"Tiling Stride",class:SelectInputView,config:{options:["0","8","16","32","64","128","256","512"],value:"128",tooltip:"The number of pixels to move the frame by during diffusion. Smaller values produce better results, but take longer. Set to 0 to disable."}},animationSize:{label:"Frame Window Size",class:NumberInputView,config:{min:8,max:64,step:1,value:null,tooltip:"The number of frames to render at once when using sliced animation diffusion. This value only has an effect if you are upcscaling an animation. Leave blank to remain unchanged."}},animationStride:{label:"Frame Window Stride",class:NumberInputView,config:{min:1,max:64,step:1,value:null,tooltip:"The number of frames to move the frame window by when using sliced animation diffusion. This value only has an effect if you are upcscaling an animation. Leave blank to remain unchanged. Set to 0 to disable sliced animation diffusion."}},tilingMaskType:{label:"Tiling Mask",class:MaskTypeInputView},noiseOffset:{label:"Noise Offset",class:NoiseOffsetInputView,config:{value:0,min:0,max:1,step:.01}},noiseMethod:{label:"Noise Method",class:NoiseMethodInputView,config:{value:"simplex"}},noiseBlendMethod:{label:"Blend Method",class:BlendMethodInputView,config:{value:"inject"}}}};static fieldSetConditions={"Upscale Diffusion":e=>e.diffusion}}class AutoSubmitUpscaleFormView extends UpscaleFormView{static autoSubmit=!0}class UpscaleFormInputView extends FormInputView{static formClass=AutoSubmitUpscaleFormView}class UpscaleStepsInputView extends RepeatableInputView{static noItemsLabel="No Upscaling";static addItemLabel="Add Upscaling Step";static memberClass=UpscaleFormInputView}class UpscaleStepsFormView extends FormView{static autoSubmit=!0;static collapseFieldSets=!0;static fieldSets={Upscaling:{steps:{class:UpscaleStepsInputView}}}}class DownscaleFormView extends FormView{static showCancel=!0;static fieldSets={"Downscale Amount":{downscale:{class:UpscaleAmountInputView,config:{tooltip:"Select the amount of downscaling to apply. Downscaling is performed via repeated bi-linear sampling."}}}}}export{UpscaleFormView,UpscaleStepsFormView,DownscaleFormView};
