MCPcopy Index your code
hub / github.com/FourthBrain/FastAPI-for-Machine-Learning-Live-Demo / generate_image

Function generate_image

main.py:34–48  ·  view source on GitHub ↗
(
    prompt: str,
    *,
    seed: int | None = None,
    num_inference_steps: int = 50,
    guidance_scale: float = 7.5
)

Source from the content-addressed store, hash-verified

32
33@app.get("/generate")
34def generate_image(
35 prompt: str,
36 *,
37 seed: int | None = None,
38 num_inference_steps: int = 50,
39 guidance_scale: float = 7.5
40):
41 image = obtain_image(
42 prompt,
43 num_inference_steps=num_inference_steps,
44 seed=seed,
45 guidance_scale=guidance_scale,
46 )
47 image.save("image.png")
48 return FileResponse("image.png")
49
50
51@app.get("/generate-memory")

Callers

nothing calls this directly

Calls 1

obtain_imageFunction · 0.90

Tested by

no test coverage detected