3v324v23's picture
feat: add NNGen project under NNGen/ and ignore local secrets
0bdbec3
raw
history blame contribute delete
488 Bytes
from __future__ import annotations
from typing import Dict, List
from ..llm.gemini import call_gemini
from ..state import AppState, ImageArtifact
def run(state: AppState) -> AppState:
prompts: List[str] = state.get("prompts", [])
res: Dict = call_gemini("image_generate", prompts=prompts, outdir=state["outdir"])
paths = res.get("paths", [])
images = [ImageArtifact(prompt=p, path=pth) for p, pth in zip(prompts, paths)]
state["images"] = images
return state