Skip to content

feat: Higgsfield Cloud API client + model priority fix#975

Merged
marcusquinn merged 2 commits intomainfrom
bugfix/higgsfield-model-priority
Feb 10, 2026
Merged

feat: Higgsfield Cloud API client + model priority fix#975
marcusquinn merged 2 commits intomainfrom
bugfix/higgsfield-model-priority

Conversation

@marcusquinn
Copy link
Owner

Summary

API Client Details

Built from the official Higgsfield API docs and Python SDK source analysis:

Feature Implementation
Auth HF_API_KEY + HF_API_SECRET from credentials.sh
Image generation apiGenerateImage() — text-to-image with auto-download
Video generation apiGenerateVideo() — image-to-video with file upload
File upload apiUploadFile() — pre-signed URL pattern from SDK
Polling apiPollStatus() — exponential backoff (2s→5s cap, 10min max)
Retry 3 attempts on transient errors (408, 429, 500, 502, 503, 504)
Model mapping 17 API model IDs (7 image, 8 video, 1 edit, 1 reference)
Fallback --api falls back to Playwright on failure; --api-only fails hard

Important: The API uses a separate credit pool from the web UI subscription. Unlimited models are web-UI only. API credits must be topped up at cloud.higgsfield.ai/credits.

New CLI Flags

--api              Use Cloud API instead of browser (separate credit pool)
--api-only         Use API only, fail if unavailable (no Playwright fallback)

New Commands

api-status         Check API credentials and connectivity

Tests

78 passing (up from 44) — covers model priority, API flag parsing, model ID mapping, credential loading, and API_MODEL_MAP structure validation.

- Fix model priority: Nano Banana Pro (Gemini 3.0) promoted to #1 from #6
  Based on Higgsfield's own docs: native 4K, best text rendering, <10s generation
- Add REST API client for cloud.higgsfield.ai (separate credit pool from web UI)
  - apiGenerateImage(): text-to-image via API with polling and auto-download
  - apiGenerateVideo(): image-to-video via API with file upload support
  - apiUploadFile(): pre-signed URL upload for local images/videos
  - apiPollStatus(): exponential backoff polling matching Python SDK pattern
  - apiStatus(): credential validation and connectivity check
  - apiRequest(): authenticated fetch with retry on transient errors (408/429/5xx)
- Add --api flag: route image/video through REST API with Playwright fallback
- Add --api-only flag: API-only mode, fail without fallback
- Add api-status command: verify API credentials and connectivity
- Add 17 API model ID mappings (7 image, 8 video, 1 edit, 1 reference)
- Fix pre-existing syntax error: missing closing brace for batchLipsync()
- Self-tests: 78 passing (up from 44), covering all new API logic
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 5 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/higgsfield-model-priority

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 36 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 10 19:06:44 UTC 2026: Code review monitoring started
Tue Feb 10 19:06:45 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 36

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 36
  • VULNERABILITIES: 0

Generated on: Tue Feb 10 19:06:47 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Extract shared logic from apiGenerateImage/apiGenerateVideo into:
- apiSubmitAndPoll(): submit + poll pattern
- apiDownloadImages(): image download + sidecar
- apiDownloadVideo(): video download + sidecar
- requireApiCredentials(): credential validation
- logApiPrompt(): truncated prompt logging

Addresses CodeFactor 'Complex Method' notices.
@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 36 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 10 19:16:12 UTC 2026: Code review monitoring started
Tue Feb 10 19:16:12 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 36

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 36
  • VULNERABILITIES: 0

Generated on: Tue Feb 10 19:16:15 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn marcusquinn merged commit eb2bd2d into main Feb 10, 2026
9 of 10 checks passed
@marcusquinn marcusquinn deleted the bugfix/higgsfield-model-priority branch February 21, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant