Repository navigation
Conversation
KuroGeo
requested review from
SBrandeis,
hanouticelina and
julien-c
as code owners
November 18, 2026 20:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When DeepInfra returns
data[0].url,textToImage()currently returns that URL string even for the default/blobordataUrloutput type. This contradicts the requested output contract and breaks callers expecting a Blob.Download URL responses for Blob/data-URL output, preserving the downloaded bytes and MIME type and forwarding the abort signal. Reject failed downloads. Explicit
urlandjsonoutput still return without downloading; the base64 response path is unchanged.Fixes #2884.
Validation (Node 22.19.0):
pnpm --filter @huggingface/inference... buildpassed, including workspace dependencies.check,lint:check, andformat:check, plusgit diff --check, passed.The tests exercise the real provider helper with synthetic provider responses and mocked image downloads; no live DeepInfra inference was called. URL downloads use the existing global
fetchpath; this patch does not add custom-fetch plumbing. Prepared with AI assistance and independently reviewed by an AI reviewer.Note
Low Risk
Scoped to DeepInfra image response shaping and an outbound fetch of provider-supplied URLs; no auth or core API contract changes beyond fixing incorrect return types.
Overview
DeepInfra
textToImageno longer returns a bare provider URL when callers ask for the default/blobordataUrloutput. For URL-shaped API responses it now downloads the image (with abortsignalforwarding), returns aBlobordataUrlviadataUrlFromBlob, and throwsInferenceClientProviderOutputErroron failed downloads.Explicit
urlandjsonoutput still skip the download; the existingb64_jsonconversion path is unchanged.Adds
deepinfra-image-output.spec.tswith mockedfetchcoverage for blob/dataUrl/url/json, failed downloads, cancellation, and base64 responses.Reviewed by Cursor Bugbot for commit 315b13d. Bugbot is set up for automated code reviews on this repo. Configure here.