節點幫助

複製 npm(開發者如何運作)

發佈 2024年9月29日
分享:

複製NPM 套件是一個強大的客戶端工具,用於將機器學習模型整合到 React 應用程式中。 它使開發人員能夠輕鬆使用預先訓練的模型,並可在他們的應用程式內直接運行推論,無需管理複雜的後端基礎設施。 以下是您可以如何使用的概述 複製 NPM 套件 在你的 React 專案中。 此外,我們將研究 IronPDF,這是一個用於生成 PDF 的庫,可以生成 PDF 並結合這兩個庫來創建一個功能正常的應用程序。

複製的介紹

複製 是一個在線平台,通過簡單的 API 提供對機器學習模型的訪問。 它托管來自各種領域的模型,例如圖像生成、文本分析等。 透過使用 'replicate' NPM 套件,開發人員可以無縫地將這些模型整合到他們的應用程式中。

入門

安裝

要在您的 React 應用中使用 `replicate`,首先需要安裝 包裝. 您可以使用 npm 或 yarn 來完成此操作:

npm install replicate
npm install replicate
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'npm install replicate
VB   C#

yarn add replicate
yarn add replicate
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'yarn add replicate
VB   C#

API 金鑰

您需要一個 API 金鑰才能與 Replicate API 互動。 您可以透過註冊以獲得此鑰匙 複製網站 並創建一個新的 API 令牌。

基本用法

以下是如何在 React 應用中使用 `replicate` 套件的逐步指南。

1. 匯入套件並初始化客戶端

import Replicate from 'replicate';
const output = new Replicate({
  auth: 'YOUR_API_TOKEN'    
});
import Replicate from 'replicate';
const output = new Replicate({
  auth: 'YOUR_API_TOKEN'    
});
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'import Replicate from 'replicate'; const output = New Replicate({ auth: 'YOUR_API_TOKEN' });
VB   C#

2. 執行推斷

假設您想要使用模型從文本生成圖像,只需幾行代碼即可獲得如下結果:

const result = await replicate.run("stability-ai/stable-diffusion", {
  input: {
    prompt: "a futuristic cityscape"
  }
}); // identifier and prediction parameters
console.log(result);
const result = await replicate.run("stability-ai/stable-diffusion", {
  input: {
    prompt: "a futuristic cityscape"
  }
}); // identifier and prediction parameters
console.log(result);
const result = Await replicate.run("stability-ai/stable-diffusion", {
	input:= { prompt:= "a futuristic cityscape" }
}) ' identifier and prediction parameters
console.log(result)
VB   C#

範例應用程式

讓我們創建一個簡單的 React 應用程式,允許用戶根據文字提示生成圖像,以展示節點複製使用。

1. 建立一個新的 React 專案:

npx create-react-app replicate-example
cd replicate-example
npm install replicate
npx create-react-app replicate-example
cd replicate-example
npm install replicate
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'npx create-react-app replicate-example cd replicate-example npm install replicate
VB   C#

2. 創建影像生成的元件:

import React, { useState } from 'react';
import Replicate from 'replicate';
const replicate = new Replicate({
  auth: 'YOUR_API_TOKEN'
});
const ImageGenerator = () => {
  const [prompt, setPrompt] = useState('');
  const [image, setImage] = useState(null);
  const generateImage = async () => {
    const result = await replicate.run("stability-ai/stable-diffusion", {
      input: { prompt }
    });
    setImage(result.output[0]);
  };
  return (
    <div>
      <h1>Image Generator</h1>
      <input
        type="text"
        value={prompt}
        onChange={(e) => setPrompt(e.target.value)} // const input
        placeholder="Enter a prompt"
      />
      <button onClick={generateImage}>Generate Image</button>
      {image && <img src={image} alt="Generated" />}// prediction object
    </div>
  );
};
export default ImageGenerator;
import React, { useState } from 'react';
import Replicate from 'replicate';
const replicate = new Replicate({
  auth: 'YOUR_API_TOKEN'
});
const ImageGenerator = () => {
  const [prompt, setPrompt] = useState('');
  const [image, setImage] = useState(null);
  const generateImage = async () => {
    const result = await replicate.run("stability-ai/stable-diffusion", {
      input: { prompt }
    });
    setImage(result.output[0]);
  };
  return (
    <div>
      <h1>Image Generator</h1>
      <input
        type="text"
        value={prompt}
        onChange={(e) => setPrompt(e.target.value)} // const input
        placeholder="Enter a prompt"
      />
      <button onClick={generateImage}>Generate Image</button>
      {image && <img src={image} alt="Generated" />}// prediction object
    </div>
  );
};
export default ImageGenerator;
'INSTANT VB TODO TASK: The following line could not be converted:
import React,
If True Then
	useState
End If
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'from 'react'; import Replicate from 'replicate'; const replicate = New Replicate({ auth: 'YOUR_API_TOKEN' }); const ImageGenerator = () => { const [prompt, setPrompt] = useState(''); const [image, setImage] = useState(Nothing); const generateImage = async() => { const result = await replicate.run("stability-ai/stable-diffusion", { input: { prompt } }); setImage(result.output[0]); }; Return(<div> <h1> Image Generator</h1> <input type="text" value={prompt} onChange={(e) => setPrompt(e.target.value)} placeholder="Enter a prompt" /> <button onClick={generateImage}> Generate Image</button> {image && <img src={image} alt="Generated" />} </div>); }; export default ImageGenerator;
VB   C#

3. 在您的應用程式中使用元件:

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import ImageGenerator from './ImageGenerator';
ReactDOM.render(
  <React.StrictMode>
    <App />
    <ImageGenerator />
  </React.StrictMode>,
  document.getElementById('root')
);
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import ImageGenerator from './ImageGenerator';
ReactDOM.render(
  <React.StrictMode>
    <App />
    <ImageGenerator />
  </React.StrictMode>,
  document.getElementById('root')
);
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import ImageGenerator from './ImageGenerator'; ReactDOM.render(<React.StrictMode> <App /> <ImageGenerator /> </React.StrictMode>, document.getElementById('root'));
VB   C#

處理錯誤

在使用 API 時,妥善處理錯誤是至關重要的。 您可以修改 'generateImage' 函數來捕捉並顯示錯誤:

const generateImage = async () => {
  try {
    const result = await replicate.run("stability-ai/stable-diffusion", {
      input: { prompt }
    });
    setImage(result.output[0]);
  } catch (error) {
    console.error("Error generating image:", error);
    alert("Failed to generate image. Please try again.");
  }
};
const generateImage = async () => {
  try {
    const result = await replicate.run("stability-ai/stable-diffusion", {
      input: { prompt }
    });
    setImage(result.output[0]);
  } catch (error) {
    console.error("Error generating image:", error);
    alert("Failed to generate image. Please try again.");
  }
};
const generateImage = Async Sub()
  Try
	const result = Await replicate.run("stability-ai/stable-diffusion", {
		input:= { prompt }
	})
	setImage(result.output(0))
  Catch e1 As [error]
	console.error("Error generating image:", [error])
	alert("Failed to generate image. Please try again.")
  End Try
End Sub
VB   C#

介紹 IronPDF

IronPDF 是一個多功能的 npm 套件,旨在簡化 Node.js 應用程式中的 PDF 生成。 它允許您從中創建 PDF 文件 HTML 內容, 網址、或現有的 PDF 文件。 不論您需要生成發票、報告或其他類型的文件,IronPDF 透過其直觀的設計讓這個過程變得輕鬆簡單。 API 和全面的功能集。

IronPDF 的主要功能

HTML 轉換為 PDF

輕鬆地 將 HTML 內容轉換為 PDF 文檔,完美適合從網頁內容生成動態 PDF。

2. 將 URL 轉換為 PDF

直接從 URL 建立 PDF,讓您能夠擷取網頁內容並以程式化方式將其儲存為 PDF 文件。

3. PDF 操作

合併輕鬆分割和操作現有 PDF 文件。 IronPDF 提供了頁面附加、文件分割等功能, 建立 PDF 表單,以及更多。

4. PDF 安全性

通过安全加固來保护您的PDF文件 加密 他們與 密碼 或應用 數位簽章,保護您的敏感文件免受未經授權的訪問。

5. 高品質輸出

生成高品質的 PDF 文件,精確呈現文字、圖像和格式,確保生成的 PDF 檔案保持原始內容的真實性。

跨平台相容性

IronPDF 與 Windows、Linux 和 macOS 的相容性,使其適合各種開發環境。

7. 簡單整合

透過 npm 包將 IronPDF 輕鬆整合到您的 Node.js 應用程式中。 文檔齊全的 API 簡化了將 PDF 生成功能納入您的項目。

無論您是在開發網頁應用程式、伺服器端腳本,還是命令列工具,IronPDF 都能讓您高效且可靠地創建專業級的 PDF 文件。

使用 IronPDF 生成 PDF 文件並使用 Recharts NPM 套件

安裝依賴項:首先,創建一個新的 Next.js 專案 (如果您還沒有) 使用以下命令:參考 這裡

npx create-next-app@latest replicate-pdf --use-npm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"
npx create-next-app@latest replicate-pdf --use-npm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'npx create-@next-app@latest replicate-pdf --use-npm --example "https://github.com/vercel/next-learn/tree/main/basics/learn-starter"
VB   C#

接著,導航至您的專案目錄:

cd replicate-pdf
cd replicate-pdf
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'cd replicate-pdf
VB   C#

安裝所需的軟體包:

yarn add @ironsoftware/ironpdf @ironsoftware/ironpdf-engine-windows-x64
yarn add replicate
yarn add @ironsoftware/ironpdf @ironsoftware/ironpdf-engine-windows-x64
yarn add replicate
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'yarn add @ironsoftware/ironpdf @ironsoftware/ironpdf-engine-windows-x64 yarn add replicate
VB   C#

建立 PDF:現在,讓我們使用 IronPDF 生成 PDF 的簡單示例。 在您的 Next.js 組件中 (例如,pages/index.tsx),新增以下代碼:

PDF 生成 API:第一步是建立一個後端 API 來生成 PDF 文件。 由於IronPDF僅在伺服器端運行,我們需要創建一個API,以便用戶在需要生成PDF時進行調用。 在路徑 pages/api/pdf/route.js 中創建一個文件,並添加以下內容:

// pages/api/pdf.js
import { NextRequest, NextResponse } from 'next/server';
import {IronPdfGlobalConfig, PdfDocument} from "@ironsoftware/ironpdf";
// Apply your IronPDF license key
IronPdfGlobalConfig.getConfig().licenseKey = "your key";
export const GET = async (req) => {
    const {searchParams} = new URL(req.url);
    const name = searchParams.get("url"); 
    try {
        const pdf = await PdfDocument.fromUrl(name);
        const data = await pdf.saveAsBuffer();
        console.error('data PDF:', data);
        return new NextResponse(data, {
            status: 200,
            headers: {
                "content-type": "application/pdf",
                "Content-Disposition": "attachment; filename=awesomeIron.pdf",
            },
        })
    } catch (error) {
        console.error('Error generating PDF:', error);
        return NextResponse.json({ detail: "error" }, { status: 500 });
    }
}
// pages/api/pdf.js
import { NextRequest, NextResponse } from 'next/server';
import {IronPdfGlobalConfig, PdfDocument} from "@ironsoftware/ironpdf";
// Apply your IronPDF license key
IronPdfGlobalConfig.getConfig().licenseKey = "your key";
export const GET = async (req) => {
    const {searchParams} = new URL(req.url);
    const name = searchParams.get("url"); 
    try {
        const pdf = await PdfDocument.fromUrl(name);
        const data = await pdf.saveAsBuffer();
        console.error('data PDF:', data);
        return new NextResponse(data, {
            status: 200,
            headers: {
                "content-type": "application/pdf",
                "Content-Disposition": "attachment; filename=awesomeIron.pdf",
            },
        })
    } catch (error) {
        console.error('Error generating PDF:', error);
        return NextResponse.json({ detail: "error" }, { status: 500 });
    }
}
' pages/api/pdf.js
import
If True Then
	NextRequest, NextResponse
End If
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'from '@next/server'; import {IronPdfGlobalConfig, PdfDocument} from "@ironsoftware/ironpdf"; IronPdfGlobalConfig.getConfig().licenseKey = "your key"; export const @GET = async(req) => { const {searchParams} = New URL(req.url); const name = searchParams.@get("url"); try { const pdf = await PdfDocument.fromUrl(name); const data = await pdf.saveAsBuffer(); console.@error('data PDF:', data); Return New NextResponse(data, { status: 200, headers: { "content-type": "application/pdf", "Content-Disposition": "attachment; filename=awesomeIron.pdf"}}) } catch(@error) { console.@error('@Error generating PDF:', @error); Return NextResponse.json({ detail: "error" }, { status: 500 }); } }
VB   C#

IronPDF 需要一個授權金鑰,您可以從 授權頁面 並放置在上述代碼中

將以下代碼添加到 index.js 中

'use client';
import { useState, useEffect, useRef } from "react";
import Image from "next/image";
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
export default function Home() {
  const [prediction, setPrediction] = useState(null);
  const [error, setError] = useState(null);
  const promptInputRef = useRef(null);
  useEffect(() => {
    promptInputRef.current.focus();
  }, []);
  const handleSubmit = async (e) => {
    e.preventDefault();
    const response = await fetch("/api/predictions", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        prompt: e.target.prompt.value,
      }),
    });
    let prediction = await response.json();
    if (response.status !== 201) {
      setError(prediction.detail);
      return;
    }
    setPrediction(prediction);
    while (
      prediction.status !== "succeeded" &&
      prediction.status !== "failed"
    ) {
      await sleep(1000);
      const response = await fetch(`/api/predictions/${prediction.id}`);
      prediction = await response.json();
      if (response.status !== 200) {
        setError(prediction.detail);
        return;
      }
      console.log({ prediction });
      setPrediction(prediction);
    }
  };
  const generatePdf = async () => {
    try {
      const response = await fetch("/api/pdf?url=" + prediction.output[prediction.output.length - 1]);
      const blob = await response.blob();
      const url = window.URL.createObjectURL(new Blob([blob]));
      const link = document.createElement("a");
      link.href = url;
      link.setAttribute("download", "awesomeIron.pdf");
      document.body.appendChild(link);
      link.click();
      link.parentNode.removeChild(link);
    } catch (error) {
      console.error("Error generating PDF:", error);
    }
  }
  return (
    <div className="container max-w-2xl mx-auto p-5">
      <h1 className="py-6 text-center font-bold text-2xl">
        IronPDF An Awesome Library for PDFs
      </h1>
      <p>Enter prompt to generate an image, Then click </p>
      <form className="w-full flex" onSubmit={handleSubmit}>
        <input
          type="text"
          className="flex-grow"
          name="prompt"
          placeholder="Enter a prompt to display an image"
          ref={promptInputRef}
        />
        <button className="button" type="submit">
          Go!
        </button>
        <button className="pdfButton" type="button" onClick={generatePdf}>
          Generate PDF
        </button>
      </form>
      {error && <div>{error}</div>}
      {prediction && (
        <>
          {prediction.output && (
            <div className="image-wrapper mt-5">
              <Image
                fill
                src={prediction.output[prediction.output.length - 1]}
                alt="output"
                sizes="100vw"
              />
            </div>
          )}
          <p className="py-3 text-sm opacity-50">status: {prediction.status}</p>
        </>
      )}
    </div>
  );
}
'use client';
import { useState, useEffect, useRef } from "react";
import Image from "next/image";
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
export default function Home() {
  const [prediction, setPrediction] = useState(null);
  const [error, setError] = useState(null);
  const promptInputRef = useRef(null);
  useEffect(() => {
    promptInputRef.current.focus();
  }, []);
  const handleSubmit = async (e) => {
    e.preventDefault();
    const response = await fetch("/api/predictions", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        prompt: e.target.prompt.value,
      }),
    });
    let prediction = await response.json();
    if (response.status !== 201) {
      setError(prediction.detail);
      return;
    }
    setPrediction(prediction);
    while (
      prediction.status !== "succeeded" &&
      prediction.status !== "failed"
    ) {
      await sleep(1000);
      const response = await fetch(`/api/predictions/${prediction.id}`);
      prediction = await response.json();
      if (response.status !== 200) {
        setError(prediction.detail);
        return;
      }
      console.log({ prediction });
      setPrediction(prediction);
    }
  };
  const generatePdf = async () => {
    try {
      const response = await fetch("/api/pdf?url=" + prediction.output[prediction.output.length - 1]);
      const blob = await response.blob();
      const url = window.URL.createObjectURL(new Blob([blob]));
      const link = document.createElement("a");
      link.href = url;
      link.setAttribute("download", "awesomeIron.pdf");
      document.body.appendChild(link);
      link.click();
      link.parentNode.removeChild(link);
    } catch (error) {
      console.error("Error generating PDF:", error);
    }
  }
  return (
    <div className="container max-w-2xl mx-auto p-5">
      <h1 className="py-6 text-center font-bold text-2xl">
        IronPDF An Awesome Library for PDFs
      </h1>
      <p>Enter prompt to generate an image, Then click </p>
      <form className="w-full flex" onSubmit={handleSubmit}>
        <input
          type="text"
          className="flex-grow"
          name="prompt"
          placeholder="Enter a prompt to display an image"
          ref={promptInputRef}
        />
        <button className="button" type="submit">
          Go!
        </button>
        <button className="pdfButton" type="button" onClick={generatePdf}>
          Generate PDF
        </button>
      </form>
      {error && <div>{error}</div>}
      {prediction && (
        <>
          {prediction.output && (
            <div className="image-wrapper mt-5">
              <Image
                fill
                src={prediction.output[prediction.output.length - 1]}
                alt="output"
                sizes="100vw"
              />
            </div>
          )}
          <p className="py-3 text-sm opacity-50">status: {prediction.status}</p>
        </>
      )}
    </div>
  );
}
'INSTANT VB TODO TASK: The following line uses invalid syntax:
''use client'; import { useState, useEffect, useRef } from "react"; import Image from "next/image"; const sleep = (ms) => New Promise((r) => setTimeout(r, ms)); export default @function Home() { const [prediction, setPrediction] = useState(Nothing); const [@error, setError] = useState(Nothing); const promptInputRef = useRef(Nothing); useEffect(() => { promptInputRef.current.focus(); }, []); const handleSubmit = async(e) => { e.preventDefault(); const response = await fetch("/api/predictions", { method: "POST", headers: { "Content-Type": "application/json"}, body: JSON.stringify({ prompt: e.target.prompt.value})}); let prediction = await response.json(); if(response.status !== 201) { setError(prediction.detail); Return; } setPrediction(prediction); while (prediction.status !== "succeeded" && prediction.status !== "failed") { await sleep(1000); const response = await fetch(`/api/predictions/${prediction.id}`); prediction = await response.json(); if(response.status !== 200) { setError(prediction.detail); Return; } console.log({ prediction }); setPrediction(prediction); } }; const generatePdf = async() => { try { const response = await fetch("/api/pdf?url=" + prediction.output[prediction.output.length - 1]); const blob = await response.blob(); const url = window.URL.createObjectURL(New Blob([blob])); const link = document.createElement("a"); link.href = url; link.setAttribute("download", "awesomeIron.pdf"); document.body.appendChild(link); link.click(); link.parentNode.removeChild(link); } catch(@error) { console.@error("Error generating PDF:", @error); } } Return(<div className="container max-w-2xl mx-auto p-5"> <h1 className="py-6 text-center font-bold text-2xl"> IronPDF An Awesome Library for PDFs </h1> <p> Enter prompt @to generate an image, @Then click </p> <form className="w-full flex" onSubmit={handleSubmit}> <input type="text" className="flex-grow" name="prompt" placeholder="Enter a prompt to display an image" ref={promptInputRef} /> <button className="button" type="submit"> Go! </button> <button className="pdfButton" type="button" onClick={generatePdf}> Generate PDF </button> </form> {@error && <div>{@error}</div>} {prediction && (<> {prediction.output && (<div className="image-wrapper mt-5"> <Image fill src={prediction.output[prediction.output.length - 1]} alt="output" sizes="100vw" /> </div>)} <p className="py-3 text-sm opacity-50"> status: {prediction.status}</p> </>)} </div>); }
VB   C#

程式碼說明

1. 匯入陳述式

程式碼先從外部庫匯入必要的模組:從「react」匯入的 'useState'、'useEffect' 和 'useRef':這些是 React Hooks,允許函式組件管理狀態、處理副作用及創建對 DOM 元素的引用。

來自 "next/image" 的 'Image': 這是 Next.js 提供的一個元件,用於優化圖像加載。 "use client" 聲明不是標準的 JavaScript 或 React 引入語法。 看起來這是針對 Next.js 的。 (React 框架) 並表明使用它的元件應該在客戶端上呈現。它確保該元件所需的 JavaScript 被發送到客戶端。

2. 元件功能

Home」組件被定義為默認匯出。 在元件內,有幾個狀態變數 (「預測」、「錯誤」) 使用 'useState' 鉤子管理。

參考 ('promptInputRef') 使用 'useRef' 鉤子創建。 「useEffect」鉤子在組件掛載時用於聚焦於「promptInputRef」。

handleSubmit」函數是一個處理表單提交的非同步函數。 它向 API 端點發送 POST 請求 (/api/predictions) 帶有提示值。

回應得到處理後,如果成功,'prediction' 狀態將被更新。 然後,該函式進入迴圈,定期檢查預測狀態,直到其成功或失敗。 「generatePdf」方法從另一個 API 端點抓取 PDF。 (/api/pdf) 根據「預測」狀態的最後輸出。

3. HTML 標記分析

該元件返回一個帶有一些樣式的容器 div ('max-w-2xl'、'mx-auto'、'p-5'). 在容器內,有一個 '

' 元素,文本為 "AwesomeIron" (這可能是專案名稱或標題).

整體而言,這段程式碼似乎是 Next.js 應用程式的一部分,用於處理預測並根據使用者輸入生成 PDF。 "使用用戶端"語句是 Next.js 特有的,它確保在使用的元件進行用戶端渲染。 如果您對程式碼的特定部分有任何具體問題

輸出

複製 npm(如何為開發人員工作):圖 1 - 使用 Replicate 和 IronPDF 的 Next.js 應用程式看起來是這樣的!

輸入要預測的文字為 "car",然後下面的圖像被預測

複製 npm (開發者如何使用):圖 2 - 在輸入提示中,添加文本「car」進行預測,然後點擊 Go 按鈕。 將使用 Replicate 預測並生成汽車的圖像。

然後點擊生成 PDF 以創建 PDF 文件

使用 IronPDF 生成的輸出 PDF

複製 npm(如何為開發人員工作):圖 3 - 接下來,您可以點擊生成 PDF 按鈕,使用 IronPDF 將此圖像轉換為 PDF。

IronPDF 授權

IronPDF 頁面。

將授權密鑰放置在應用程式中,如以下示例所示:

import {IronPdfGlobalConfig, PdfDocument} from "@ironsoftware/ironpdf";
// Apply your IronPDF license key
IronPdfGlobalConfig.getConfig().licenseKey = "Add Your key here";
import {IronPdfGlobalConfig, PdfDocument} from "@ironsoftware/ironpdf";
// Apply your IronPDF license key
IronPdfGlobalConfig.getConfig().licenseKey = "Add Your key here";
IRON VB CONVERTER ERROR developers@ironsoftware.com
VB   C#

結論

[複製](https://www.npmjs.com/package/replicate)\ NPM 套件為 React 應用程式提供了一種方便的方法來利用強大的機器學習模型。 通過遵循本文概述的步驟,您可以輕鬆將圖像生成功能整合到您的項目中。 這為創造創新和互動的用戶體驗開闢了廣泛的可能性。

請記得探索 Iron Software 提供的其他模型。 複製 平台進一步擴展您的應用程式功能。

另外, IronPDF 是一個強大的 PDF 程式庫,具備 PDF 生成和操作功能,以及能夠 渲染響應式圖表 即時在 PDF 中。 它使開發人員能夠僅用幾行程式碼將功能豐富的圖表套件整合到應用程式中。 結合這兩個庫,開發人員可以使用現代 AI 技術並可靠地以 PDF 形式保存結果。

< 上一頁
xml2js npm(它如何為開發人員運作)
下一個 >
toastify npm(如何為開發者工作)

準備開始了嗎? 版本: 2024.9 剛剛發布

免費 npm 安裝 查看許可證 >