Skip to content

Add ovgenai image diffusion (Stable Diffusion / SDXL) — #197 - #198

Open
atrebek07 wants to merge 1 commit into
SearchSavior:mainfrom
atrebek07:diffusion
Open

atrebek07 wants to merge 1 commit into
SearchSavior:mainfrom
atrebek07:diffusion

Conversation

@atrebek07

Copy link
Copy Markdown
Contributor

Closes issue #197.

Adds text-to-image generation to the OpenArc server via OpenVINO GenAI

What's new

  • Engine src/engine/ov_genai/diffusion.py — OVGenAI_Diffusion text-to-image pipeline.
  • Schema contract contract_ovgenai_diffusion.py — OVGenAI_DiffusionGenConfig (prompt, negative_prompt, guidance_scale, height/width, num_inference_steps, num_images_per_prompt, seed, strength, max_sequence_length).
  • Endpoint POST /v1/images/generations (OpenAI-compatible). Returns b64_json base64 PNGs; also saves each PNG to output/ and reports its path in file.
  • Model type diffusion added to ModelType, MODEL_CLASS_REGISTRY, the worker registry, and openarc add.
  • CLI: openarc add --model-type diffusion exposes the config fields as flags (--guidance-scale, --num-inference-steps, --seed, ...); the server startup banner lists the new endpoint.
  • Docs: configure.md (load_config + Diffusion example + seed behavior), models.md (SD1.5/SDXL links), index.md (Image Diffusion).
  • output/ tracked via a placeholder; generated images are gitignored.

Behavior / caveats

  • Tested models: SD1.5 and SDXL. (SD3/Flux/LCM are supported by the pipeline, but not directly tested.)
  • seed: if unset, the server draws a random seed per request (non-deterministic). Set it for reproducible images.
  • strength: image-to-image knob; rejected by the text-to-image route (use guidance_scale to steer).
  • response_format: b64_json only
  • Cancellation: the route races generation against a client-disconnect watcher, but RequestLoggingMiddleware is a BaseHTTPMiddleware, which swallows the http.disconnect message. Because of this, mid-denoise cancellation does not currently fire. A bare-ASGI middleware fixes it; this could be added as a separate PR.

Development environment

  • Tested on an Intel Arc Pro B50 in Ubuntu 24.04.5 LTS (kernel 7.0.0-38-generic)
  • Code generated by Qwen-3.8-Flash-Next-Coder, served by llama.cpp, harnessed by maki, and guided & verified by me at every step.

@SearchSavior

Copy link
Copy Markdown
Owner

@atrebek07 Hey! I tested everything locally and made some images. The API standard matches and on Discord you mentioned it supports other models supported by openvino. Excellent work!

Lmk when its ready to merge

Text-to-image generation via OpenVINO GenAI:
- OVGenAI_Diffusion engine + OVGenAI_DiffusionGenConfig schema contract
- OpenAI-compatible /v1/images/generations route (b64_json)
- model type, registry, worker, and CLI add wiring
- track output/ dir via placeholder; ignore generated images

Refs SearchSavior#197
@atrebek07

Copy link
Copy Markdown
Contributor Author

@SearchSavior It’s ready now. Just force-pushed two small edits: changed the text displayed at server start, and changed the naming of generated images. Post-edits testing didn’t show any issues.

And yeah, as I said on Discord, the v1/images/generations endpoint should work with all of the models ovgenai has a pipeline for. I tested with FLUX.2-klein and Qwen-Image-2.1 this weekend.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants