Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
konieshadow committed Oct 10, 2023
1 parent b83d945 commit ae70f76
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,9 @@
"title": "Prompt",
"default": ""
},
"negative_promit": {
"negative_prompt": {
"type": "string",
"title": "Negative Promit",
"title": "Negative Prompt",
"default": ""
},
"style_selections": {
Expand Down Expand Up @@ -720,9 +720,9 @@
"title": "Prompt",
"default": ""
},
"negative_promit": {
"negative_prompt": {
"type": "string",
"title": "Negative Promit",
"title": "Negative Prompt",
"default": ""
},
"style_selections": {
Expand Down Expand Up @@ -902,9 +902,9 @@
"title": "Prompt",
"default": ""
},
"negative_promit": {
"negative_prompt": {
"type": "string",
"title": "Negative Promit",
"title": "Negative Prompt",
"default": ""
},
"style_selections": {
Expand Down Expand Up @@ -1360,9 +1360,9 @@
"title": "Prompt",
"default": ""
},
"negative_promit": {
"negative_prompt": {
"type": "string",
"title": "Negative Promit",
"title": "Negative Prompt",
"default": ""
},
"style_selections": {
Expand Down
2 changes: 1 addition & 1 deletion fooocus_api_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '0.1.11'
version = '0.1.12'
4 changes: 2 additions & 2 deletions fooocusapi/api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions fooocusapi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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,
Expand All @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions fooocusapi/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fooocusapi/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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,
Expand Down

0 comments on commit ae70f76

Please sign in to comment.