16 lines
449 B
Python
16 lines
449 B
Python
from fastapi import FastAPI
|
|
from pydantic import BaseModel
|
|
|
|
app = FastAPI(title="Image Generation Stub")
|
|
|
|
class ImageRequest(BaseModel):
|
|
prompt: str
|
|
style: str = "default"
|
|
|
|
@app.post("/generate")
|
|
def generate_image(req: ImageRequest):
|
|
# Just a stub, returns a placeholder
|
|
return {"image_url": f"https://dummyimage.com/512x512/000/fff&text={req.prompt.replace(' ', '+')}"}
|
|
|
|
# Run: uvicorn image_service:app --host 0.0.0.0 --port 5100
|