* Refactor ModelScope Image Generator to use new Async API.
Updates `ModelScopeImageGenerator` in `nodes.py` to:
- Use `v1/images/generations` with `X-ModelScope-Async-Mode: true`.
- Implement polling logic for task completion.
- Update input parameters to match API documentation (steps, guidance, seed, loras, size).
- Support `loras` as string or JSON dict.
* Initial plan
* Address all review comments from PR review thread
Co-authored-by: neverbiasu <90372299+neverbiasu@users.noreply.github.com>
* Add .gitignore and remove __pycache__
Co-authored-by: neverbiasu <90372299+neverbiasu@users.noreply.github.com>
* Move logging import to top and improve headers copy
Co-authored-by: neverbiasu <90372299+neverbiasu@users.noreply.github.com>
* Define logger at module level and fix formatting
Co-authored-by: neverbiasu <90372299+neverbiasu@users.noreply.github.com>
* Refactor ModelScope Image Generator API
Updates `ModelScopeImageGenerator` to use the asynchronous `v1/images/generations` endpoint.
- Implements task polling logic with timestamp-based timeout.
- Adds fail-fast logic for 4xx client errors during polling.
- Updates input parameters to match API: `steps`, `guidance`, `seed`, `loras`.
- Supports `loras` as JSON dict or string ID.
- Uses `logging` instead of `print`.
- Ensures UTF-8 charset in headers for multi-language support.
* Simplify loras parsing logic to avoid duplication
Co-authored-by: neverbiasu <90372299+neverbiasu@users.noreply.github.com>
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: neverbiasu <90372299+neverbiasu@users.noreply.github.com>
- Renamed `PIL_Image` local variable to `pil_image` to match naming conventions.
- Introduced constants `PLACEHOLDER_MODEL_ID`, `PLACEHOLDER_API_KEY`, and `CONTENT_TYPE_JSON` to remove duplicated literals.
- Removed `verify=False` from `requests.post` calls to enable SSL certificate validation.