@@ -41,7 +41,7 @@ class UpscaleOrVaryMethod(str, Enum):
41
41
upscale_15 = 'Upscale (1.5x)'
42
42
upscale_2 = 'Upscale (2x)'
43
43
upscale_fast = 'Upscale (Fast 2x)'
44
-
44
+ upscale_custom = 'Upscale (Custom)'
45
45
46
46
class OutpaintExpansion (str , Enum ):
47
47
left = 'Left'
@@ -122,10 +122,12 @@ class Text2ImgRequest(BaseModel):
122
122
class ImgUpscaleOrVaryRequest (Text2ImgRequest ):
123
123
input_image : UploadFile
124
124
uov_method : UpscaleOrVaryMethod
125
+ upscale_value : float
125
126
126
127
@classmethod
127
128
def as_form (cls , input_image : UploadFile = Form (description = "Init image for upsacale or outpaint" ),
128
129
uov_method : UpscaleOrVaryMethod = Form (),
130
+ upscale_value : float = Form (default = 1.0 , ge = 1.0 , le = 5.0 ),
129
131
prompt : str = Form ('' ),
130
132
negative_prompt : str = Form (default_prompt_negative ),
131
133
style_selections : List [str ] = Form (defualt_styles , description = "Fooocus style selections, seperated by comma" ),
@@ -168,7 +170,7 @@ def as_form(cls, input_image: UploadFile = Form(description="Init image for upsa
168
170
errs = ve .errors ()
169
171
raise RequestValidationError (errors = [errs ])
170
172
171
- return cls (input_image = input_image , uov_method = uov_method , prompt = prompt , negative_prompt = negative_prompt , style_selections = style_selection_arr ,
173
+ return cls (input_image = input_image , uov_method = uov_method ,upscale_value = upscale_value , prompt = prompt , negative_prompt = negative_prompt , style_selections = style_selection_arr ,
172
174
performance_selection = performance_selection , aspect_ratios_selection = aspect_ratios_selection ,
173
175
image_number = image_number , image_seed = image_seed , sharpness = sharpness , guidance_scale = guidance_scale ,
174
176
base_model_name = base_model_name , refiner_model_name = refiner_model_name , refiner_switch = refiner_switch ,
0 commit comments