mrhan1993 / Fooocus-API

FastAPI powered API for Fooocus
GNU General Public License v3.0
558 stars 148 forks source link

The api cannot be used. #96

Closed hailowck closed 8 months ago

hailowck commented 8 months ago

Help, why can't my api be used, even if it has been added to the environment variable?Is it because api charges?

mrhan1993 commented 8 months ago

@hailowck more detail

hailowck commented 8 months ago

@mrhan1993

屏幕截图 2023-12-16 192729 屏幕截图 2023-12-16 192333 屏幕截图 2023-12-16 192325
hailowck commented 8 months ago

@mrhan1993 this

屏幕截图 2023-12-18 144450
mrhan1993 commented 8 months ago
import replicate
import os
os.environ['REPLICATE_API_TOKEN'] = 'USE_YOUR_TOKEN_REPLACE'
output = replicate.run(
  "konieshadow/fooocus-api-anime:3b1d4e280c9427ad6616b47a08e17ea03f25c4851bdb039dc86fd552fc49fff4",
  input={
    "prompt": "1 girl",
    "cn_type1": "ImagePrompt",
    "cn_type2": "ImagePrompt",
    "cn_type3": "ImagePrompt",
    "cn_type4": "ImagePrompt",
    "sharpness": 2,
    "image_seed": 6752341482620184000,
    "uov_method": "Disabled",
    "image_number": 1,
    "guidance_scale": 7,
    "refiner_switch": 0.66,
    "negative_prompt": "(embedding:unaestheticXLv31:0.8), low quality, watermark",
    "style_selections": "Fooocus V2,Fooocus Masterpiece,SAI Anime,SAI Digital Art,SAI Enhance,SAI Fantasy Art",
    "outpaint_selections": "",
    "performance_selection": "Speed",
    "aspect_ratios_selection": "1152×896"
  }
)
print(output)

图片

hailowck commented 8 months ago
进口 复制
进口 操作系统
操作系统.环境['复制API_TOKEN'] = 'USE_YOUR_TOKEN_REPLACE'
输出 = 复制.运行(
  "konieshadow/fooocus-api-anime:3b1d4e280c9427ad6616b47a08e17ea03f25c4851bdb039dc86fd552fc49fff4",
  输入={
    “提示”: “1个女孩”,
    "cn_type1": "图像提示",
    "cn_type2": "图像提示",
    "cn_type3": "图像提示",
    "cn_type4": "图像提示",
    “锐度”: 2,
    "图像种子": 6752341482620184000,
    "uov_method": "已禁用",
    "图像编号": 1,
    "指导_比例": 7,
    "优化器开关": 0.66,
    "negative_prompt": (嵌入:不美学XLv31:0.8 ) ,质量低,水印”,
    "样式选择": “Foocus V2、Foocus杰作、SAI动漫、SAI数字艺术、SAI增强、SAI奇幻艺术”,
    "外漆选择": "",
    "性能选择": “速度”,
    "宽高比选择": "1152×896"
  }
)
印刷品(输出)

图片

Ok, thank you very much.