-
Notifications
You must be signed in to change notification settings - Fork 744
FEAT: OpenAI image edit api support #4110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
xinference/api/restful_api.py
Outdated
return Response(content=image_list, media_type="application/json") | ||
except asyncio.CancelledError: | ||
err_str = f"The request has been cancelled: {request_id}" | ||
err_str = f"The request has been cancelled: {request_id or 'unknown'}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems irrelevant.
xinference/api/restful_api.py
Outdated
if not prompt: | ||
raise HTTPException(status_code=400, detail="Prompt is required") | ||
|
||
if len(prompt) > 1000: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't actually need this check.
return Response(content=video_list, media_type="application/json") | ||
except asyncio.CancelledError: | ||
err_str = f"The request has been cancelled: {request_id}" | ||
err_str = f"The request has been cancelled: {request_id or 'unknown'}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
async def _stream_image_edit( | ||
self, model_ref, images, mask, prompt, size, response_format, n | ||
): | ||
"""Stream image editing progress and results""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image_to_image and so forth do not support stream yet, can this functionality work?
self._model_uid = model_uid | ||
self._base_url = base_url | ||
self.auth_headers = auth_headers | ||
# 设置更长的默认超时,因为图像编辑需要很长时间 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments should be English only.
fix: #4079