Linux 软件免费装
Banner图

AI Provider for Hugging Face

开发者 aslamdoctor
更新时间 2026年4月14日 12:21
PHP版本: 7.4 及以上
WordPress版本: 7.0
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

ai image-generation connectors hugging-face ai-client

下载

1.0.0 1.1.0

详情介绍:

This plugin registers Hugging Face as an AI provider for the WordPress AI Client introduced in WordPress 7.0. It enables text and image generation through Hugging Face's Inference API using popular open-source models. Features: Usage: $result = wp_ai_client_prompt( 'Summarize the benefits of caching.' ) ->using_temperature( 0.7 ) ->generate_text(); // Generate an image $image = wp_ai_client_prompt( 'A futuristic WordPress logo in neon colors' ) ->generate_image();

安装:

  1. Upload the plugin to the /wp-content/plugins/ai-provider-for-hugging-face directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Go to Hugging Face Tokens and create a new Access Token with Read permission.
  4. Go to Settings > Connectors and enter your Hugging Face API token.
You can also set the API key via environment variable or PHP constant: // Environment variable HUGGING_FACE_API_KEY=hf_**** // PHP constant in wp-config.php define( 'HUGGING_FACE_API_KEY', 'hf_****' );

屏幕截图:

  • Settings > Hugging Face admin page with text and image model configuration.

常见问题:

Which models are supported?

The plugin dynamically fetches the top 20 most popular text and image generation models from HuggingFace, updated every 12 hours. You can also add any model via the Custom Models field in Settings > Hugging Face, or using the hugging_face_ai_provider_models and hugging_face_ai_provider_image_models filters.

Do I need to pay for HuggingFace?

Models on the free "hf-inference" provider work without credits. Other providers (fal-ai, replicate, etc.) require pre-paid HuggingFace credits. The plugin automatically selects the best available provider, preferring the free tier.

Can I use a self-hosted model?

Yes. Use the hugging_face_ai_provider_base_url filter for text generation or hugging_face_ai_provider_image_url filter for image generation to point to your own inference instance.

What capabilities are supported?

Text generation and image generation. Video generation support may be added in future versions.

更新日志:

1.1.0 1.0.0