a / main.py
raajarajan's picture
Create main.py
c5e8341
raw
history blame contribute delete
445 Bytes
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