mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
feat(images): add seed, steps, negative_prompt, and extra_params to ComfyUI image edit endpoint
This commit is contained in:
parent
c3eaed3c5f
commit
f998e0881e
2 changed files with 17 additions and 0 deletions
|
|
@ -870,6 +870,9 @@ class EditImageForm(BaseModel):
|
|||
n: int | None = None
|
||||
negative_prompt: str | None = None
|
||||
background: str | None = None
|
||||
seed: int | None = None
|
||||
steps: int | None = None
|
||||
extra_params: dict | None = None
|
||||
|
||||
|
||||
@router.post('/edit')
|
||||
|
|
@ -1153,6 +1156,18 @@ async def image_edits(
|
|||
**({'n': form_data.n} if form_data.n else {}),
|
||||
}
|
||||
|
||||
if form_data.negative_prompt is not None:
|
||||
data['negative_prompt'] = form_data.negative_prompt
|
||||
|
||||
if form_data.seed is not None:
|
||||
data['seed'] = form_data.seed
|
||||
|
||||
if form_data.steps is not None:
|
||||
data['steps'] = form_data.steps
|
||||
|
||||
if form_data.extra_params:
|
||||
data['extra_params'] = form_data.extra_params
|
||||
|
||||
form_data = ComfyUIEditImageForm(
|
||||
**{
|
||||
'workflow': ComfyUIWorkflow(
|
||||
|
|
|
|||
|
|
@ -284,12 +284,14 @@ class ComfyUIEditImageForm(BaseModel):
|
|||
|
||||
image: str | list[str]
|
||||
prompt: str
|
||||
negative_prompt: Optional[str] = None
|
||||
width: Optional[int] = None
|
||||
height: Optional[int] = None
|
||||
n: Optional[int] = None
|
||||
|
||||
steps: Optional[int] = None
|
||||
seed: Optional[int] = None
|
||||
extra_params: Optional[dict] = None
|
||||
|
||||
|
||||
async def comfyui_edit_image(model: str, payload: ComfyUIEditImageForm, client_id, base_url, api_key):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue