diff --git a/docs/openapi.json b/docs/openapi.json index e75d332..51b9e90 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -396,9 +396,9 @@ "title": "Prompt", "default": "" }, - "negative_promit": { + "negative_prompt": { "type": "string", - "title": "Negative Promit", + "title": "Negative Prompt", "default": "" }, "style_selections": { @@ -720,9 +720,9 @@ "title": "Prompt", "default": "" }, - "negative_promit": { + "negative_prompt": { "type": "string", - "title": "Negative Promit", + "title": "Negative Prompt", "default": "" }, "style_selections": { @@ -902,9 +902,9 @@ "title": "Prompt", "default": "" }, - "negative_promit": { + "negative_prompt": { "type": "string", - "title": "Negative Promit", + "title": "Negative Prompt", "default": "" }, "style_selections": { @@ -1360,9 +1360,9 @@ "title": "Prompt", "default": "" }, - "negative_promit": { + "negative_prompt": { "type": "string", - "title": "Negative Promit", + "title": "Negative Prompt", "default": "" }, "style_selections": { diff --git a/fooocus_api_version.py b/fooocus_api_version.py index 83a3124..8bdf162 100644 --- a/fooocus_api_version.py +++ b/fooocus_api_version.py @@ -1 +1 @@ -version = '0.1.11' \ No newline at end of file +version = '0.1.12' \ No newline at end of file diff --git a/fooocusapi/api_utils.py b/fooocusapi/api_utils.py index 751862b..fb782bc 100644 --- a/fooocusapi/api_utils.py +++ b/fooocusapi/api_utils.py @@ -43,7 +43,7 @@ def read_input_image(input_image: UploadFile) -> np.ndarray: def req_to_params(req: Text2ImgRequest) -> ImageGenerationParams: prompt = req.prompt - negative_prompt = req.negative_promit + negative_prompt = req.negative_prompt style_selections = [s.value for s in req.style_selections] performance_selection = req.performance_selection.value aspect_ratios_selection = req.aspect_ratios_selection.value @@ -82,7 +82,7 @@ def req_to_params(req: Text2ImgRequest) -> ImageGenerationParams: (cn_img, img_prompt.cn_stop, img_prompt.cn_weight, img_prompt.cn_type.value)) return ImageGenerationParams(prompt=prompt, - negative_promit=negative_prompt, + negative_prompt=negative_prompt, style_selections=style_selections, performance_selection=performance_selection, aspect_ratios_selection=aspect_ratios_selection, diff --git a/fooocusapi/models.py b/fooocusapi/models.py index 8ed8f0e..7dfb7e2 100644 --- a/fooocusapi/models.py +++ b/fooocusapi/models.py @@ -271,7 +271,7 @@ class ImagePrompt(BaseModel): class Text2ImgRequest(BaseModel): prompt: str = '' - negative_promit: str = '' + negative_prompt: str = '' style_selections: List[FooocusStyle] = [ FooocusStyle.fooocus_expansion, FooocusStyle.default] performance_selection: PerfomanceSelection = PerfomanceSelection.speed @@ -295,7 +295,7 @@ class ImgUpscaleOrVaryRequest(Text2ImgRequest): def as_form(cls, input_image: UploadFile = Form(description="Init image for upsacale or outpaint"), uov_method: UpscaleOrVaryMethod = Form(), prompt: str = Form(''), - negative_promit: str = Form(''), + negative_prompt: str = Form(''), style_selections: List[str] = Form([ FooocusStyle.fooocus_expansion, FooocusStyle.default], description="Fooocus style selections, seperated by comma"), performance_selection: PerfomanceSelection = Form( @@ -342,7 +342,7 @@ def as_form(cls, input_image: UploadFile = Form(description="Init image for upsa if lora_model is not None and len(lora_model) > 0: loras.append(Lora(model_name=lora_model, weight=lora_weight)) - return cls(input_image=input_image, uov_method=uov_method, prompt=prompt, negative_promit=negative_promit, style_selections=style_selection_arr, + return cls(input_image=input_image, uov_method=uov_method, prompt=prompt, negative_prompt=negative_prompt, style_selections=style_selection_arr, performance_selection=performance_selection, aspect_ratios_selection=aspect_ratios_selection, image_number=image_number, image_seed=image_seed, sharpness=sharpness, guidance_scale=guidance_scale, base_model_name=base_model_name, refiner_model_name=refiner_model_name, @@ -361,7 +361,7 @@ def as_form(cls, input_image: UploadFile = Form(description="Init image for inpa outpaint_selections: List[str] = Form( [], description="Outpaint expansion selections, literal 'Left', 'Right', 'Top', 'Bottom' seperated by comma"), prompt: str = Form(''), - negative_promit: str = Form(''), + negative_prompt: str = Form(''), style_selections: List[str] = Form([ FooocusStyle.fooocus_expansion, FooocusStyle.default], description="Fooocus style selections, seperated by comma"), performance_selection: PerfomanceSelection = Form( @@ -424,7 +424,7 @@ def as_form(cls, input_image: UploadFile = Form(description="Init image for inpa if lora_model is not None and len(lora_model) > 0: loras.append(Lora(model_name=lora_model, weight=lora_weight)) - return cls(input_image=input_image, input_mask=input_mask, outpaint_selections=outpaint_selections_arr, prompt=prompt, negative_promit=negative_promit, style_selections=style_selection_arr, + return cls(input_image=input_image, input_mask=input_mask, outpaint_selections=outpaint_selections_arr, prompt=prompt, negative_prompt=negative_prompt, style_selections=style_selection_arr, performance_selection=performance_selection, aspect_ratios_selection=aspect_ratios_selection, image_number=image_number, image_seed=image_seed, sharpness=sharpness, guidance_scale=guidance_scale, base_model_name=base_model_name, refiner_model_name=refiner_model_name, @@ -467,7 +467,7 @@ def as_form(cls, cn_img1: UploadFile = Form(File(None), description="Input image cn_type4: ControlNetType = Form( default=ControlNetType.cn_ip, description="ControlNet type for image prompt"), prompt: str = Form(''), - negative_promit: str = Form(''), + negative_prompt: str = Form(''), style_selections: List[str] = Form([ FooocusStyle.fooocus_expansion, FooocusStyle.default], description="Fooocus style selections, seperated by comma"), performance_selection: PerfomanceSelection = Form( @@ -533,7 +533,7 @@ def as_form(cls, cn_img1: UploadFile = Form(File(None), description="Input image if lora_model is not None and len(lora_model) > 0: loras.append(Lora(model_name=lora_model, weight=lora_weight)) - return cls(image_prompts=image_prompts, prompt=prompt, negative_promit=negative_promit, style_selections=style_selection_arr, + return cls(image_prompts=image_prompts, prompt=prompt, negative_prompt=negative_prompt, style_selections=style_selection_arr, performance_selection=performance_selection, aspect_ratios_selection=aspect_ratios_selection, image_number=image_number, image_seed=image_seed, sharpness=sharpness, guidance_scale=guidance_scale, base_model_name=base_model_name, refiner_model_name=refiner_model_name, diff --git a/fooocusapi/parameters.py b/fooocusapi/parameters.py index a756530..80236ab 100644 --- a/fooocusapi/parameters.py +++ b/fooocusapi/parameters.py @@ -19,7 +19,7 @@ def __init__(self, im: np.ndarray | None, seed: int, finish_reason: GenerationFi class ImageGenerationParams(object): def __init__(self, prompt: str, - negative_promit: str, + negative_prompt: str, style_selections: List[str], performance_selection: List[str], aspect_ratios_selection: str, @@ -36,7 +36,7 @@ def __init__(self, prompt: str, inpaint_input_image: Dict[str, np.ndarray] | None, image_prompts: List[Tuple[BinaryIO, float, float, str]]): self.prompt = prompt - self.negative_promit = negative_promit + self.negative_prompt = negative_prompt self.style_selections = style_selections self.performance_selection = performance_selection self.aspect_ratios_selection = aspect_ratios_selection diff --git a/fooocusapi/worker.py b/fooocusapi/worker.py index bc71412..97a7d85 100644 --- a/fooocusapi/worker.py +++ b/fooocusapi/worker.py @@ -75,7 +75,7 @@ def make_results_from_outputs(): # Transform pamameters prompt = params.prompt - negative_prompt = params.negative_promit + negative_prompt = params.negative_prompt style_selections = params.style_selections performance_selection = params.performance_selection aspect_ratios_selection = params.aspect_ratios_selection diff --git a/predict.py b/predict.py index 4d1a655..ad01a2d 100644 --- a/predict.py +++ b/predict.py @@ -34,7 +34,7 @@ def predict( from modules.util import generate_temp_filename import modules.flags as flags - negative_promit = '' + negative_prompt = '' style_selections = ['Fooocus V2', 'Default (Slightly Cinematic)'] performance_selection = 'Spped' aspect_ratios_selection = '1152×896' @@ -52,7 +52,7 @@ def predict( image_prompts = [] params = ImageGenerationParams(prompt=prompt, - negative_promit=negative_promit, + negative_prompt=negative_prompt, style_selections=style_selections, performance_selection=performance_selection, aspect_ratios_selection=aspect_ratios_selection,