元編程參考文件

擁抱臉雲服務(HuggingFace)

3 個節點

本頁內容 3

圖片+指令到文字

函數

從影像URL和輸入提示生成文字描述,使用指定的HuggingFace模型。

簽名
圖片+指令到文字 -> 文字
    影像網址: 文字
    指令: 文字
    模型名稱: 文字
    配置: Hugging Face Configuration
string ImageTextToImage(
    string imageUrl,
    string prompt = "Describe this image in one sentence.",
    string model = "Qwen/QVQ-72B-preview",
    HuggingFaceServerless.HuggingFaceConfiguration configuration)

參數

名稱型別預設值說明
影像網址文字—影像的URL。
指令文字Describe this image in one sentence.文字提示(預設是“用一句話描述這幅影像。”)。
模型名稱文字Qwen/QVQ-72B-preview模型識別符號(預設是“Qwen/QVQ-72B-preview”)。
配置Hugging Face Configuration—包含API金鑰的可選配置。

返回

生成的文字描述文字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
擁抱臉雲服務(HuggingFace)
所屬包
生成式 AI

文字生成

函數

根據提供的輸入使用指定的HuggingFace模型生成文字。

簽名
文字生成 -> 文字
    文字: 文字
    模型: 文字
    配置: Hugging Face Configuration
string TextGeneration(
    string inputText,
    string model = "openai-community/gpt2",
    HuggingFaceServerless.HuggingFaceConfiguration configuration)

參數

名稱型別預設值說明
文字文字—輸入文字提示。
模型文字openai-community/gpt2模型識別符號(預設為"openai-community/gpt2")。
配置Hugging Face Configuration—包含API金鑰的可選配置。

返回

生成的文字響應文字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
擁抱臉雲服務(HuggingFace)
所屬包
生成式 AI

文字到影像

函數

使用指定的HuggingFace模型從提供的文字生成影像。

簽名
文字到影像 -> Pixel Image
    文字: 文字
    模型: 文字
    寬度: 整數
    高度: 整數
    配置: Hugging Face Configuration
PixelImage TextToImage(
    string inputText,
    string model = "black-forest-labs/FLUX.1-dev",
    int width = 512,
    int height = 512,
    HuggingFaceServerless.HuggingFaceConfiguration configuration)

參數

名稱型別預設值說明
文字文字—影像生成的文字提示。
模型文字black-forest-labs/FLUX.1-dev模型識別符號(預設是“black-forest-labs/FLUX.1-dev”)。
寬度整數512期望的影像寬度(預設是512)。
高度整數512期望的影像高度(預設是512)。
配置Hugging Face Configuration—可選配置,包含API金鑰。

返回

生成的影像Pixel Image
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
擁抱臉雲服務(HuggingFace)
所屬包
生成式 AI