Skip to content

The everything you should know about basic_api.pyΒ #4

@202030481266

Description

@202030481266

I have tested these API codes in a production environment and they are quite fragile, but I still want to say a few words.

  1. For secure communication over HTTPS, it is advisable to employ the WSS (WebSocket Secure) protocol.
  2. The implementation of the get_images function appears to be flawed. (pay attention to output_data variable)
  3. This script incorporates hard-coding by directly formatting the API address instead of referencing a configuration file.
  4. Should you choose to manually terminate the process, a subtle warning will be issued, which is perfectly tolerable.
  5. When using this script, you should fully understand the backend of Comfyui (for example, Comfyui will consider the image path as the standard for whether the image has changed, the best practice is to use uuid.)
  6. load_workflowfunction doesn't take encoding into account.
  7. The save_image function appears to be totally wrong. (it use the try-except machnism but not a if-else logic, if you save_previews are False, you will always get some fails.)

Last but not least, the backend of Comfyui is not as powerful as you imagine, in fact, it is quite fragile. So when your usage scenario is under pressure, please consider other deployment methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions