xtekky/gpt4free · error · RuntimeError
No images found
Error message
No images found
What it means
Raised by read_images() when BeautifulSoup finds no <img> tags with class "mimg" (or the fallback class "gir_mmimg") in the Bing results HTML, producing an empty image list. It means the polling loop ended with a page that looks complete but contains no result markup — typically a layout change or an empty/silent failure page from Bing.
Source
Thrown at g4f/Provider/needs_auth/bing/create_images.py:163
def read_images(html_content: str) -> List[str]:
"""
Extracts image URLs from the HTML content.
Args:
html_content (str): HTML content containing image URLs.
Returns:
List[str]: A list of image URLs.
"""
soup = BeautifulSoup(html_content, "html.parser")
tags = soup.find_all("img", class_="mimg")
if not tags:
tags = soup.find_all("img", class_="gir_mmimg")
images = [img["src"].split("?w=")[0] for img in tags]
if any(im in BAD_IMAGES for im in images):
raise RuntimeError("Bad images found")
if not images:
raise RuntimeError("No images found")
return images
View on GitHub (pinned to 973504e177)
Solutions
- Update g4f to the latest version — selector breakage against Bing's markup is fixed upstream
- Log/dump the returned HTML to confirm which page Bing actually served
- Retry — transient empty responses occur under load
- Switch to another image provider if Bing markup has changed and no fix is released yet
Defensive patterns
Strategy: fallback
Try / catch
try:
images = await create_images(client, prompt)
except RuntimeError as e:
if "No images found" in str(e):
images = await other_image_provider(prompt) # markup drift, not your fault
else:
raise Prevention
- Pin a known-good g4f version rather than a stale one when relying on scraped HTML
- Update g4f promptly when Bing ships frontend changes
- Keep a secondary image provider configured for automatic fallback
When it happens
Trigger: Bing returns an HTML results page without mimg/gir_mmimg img elements — e.g. after a frontend markup change, an A/B variant, or an error page that lacks the GenerativeImagesStatusPage marker the polling loop checks for.
Common situations: Outdated g4f version after Bing ships a markup redesign; regional Bing variants serving different DOM; responses that are JSON errors not matching the errorMessage checks.
Related errors
- Missing "_U" cookie
- Invalid image element: {element}
- No coins left. Log in with a different account or wait a whi
- Create images failed: {error}
- Create images failed. Code: {response.status}
AI-assisted analysis of xtekky/gpt4free@973504e177 (2026-08-14).
Data as JSON: /api/errors/c4eb2a78eb167df7.
Report an issue: GitHub.