Spaces:
Runtime error
Runtime error
File size: 445 Bytes
c5e8341 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from fastapi import FastAPI
from diffusers import DiffusionPipeline
import json
import requests
from PIL import Image
from io import BytesIO
app = FastAPI()
pipeline = DiffusionPipeline.from_pretrained("ogkalu/Comic-Diffusion")
pipeline = pipeline.to("cpu")
@app.get("/")
def read_root():
prompt = "anime boy"
image = pipeline(prompt,width=256,height=256,num_inference_steps=10).images[0]
print('Success Ok')
return image
|