saddam213's picture
Upload 23 files
5fc6833 verified
metadata
pipeline_tag: image-to-image

FLUX.1-Kontext - Onnx Olive DirectML Optimized

Original Model

https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev

C# Inference Demo

https://github.com/TensorStack-AI/OnnxStack

// Create Pipeline
var pipeline = FluxPipeline.CreatePipeline("D:\\Models\\FLUX.1-Kontext-amuse", ModelType.Instruct);

// Prompt
var promptOptions = new PromptOptions
{
    Prompt = "Add sunglasses and a hat to the woman"
};

// Scheduler Options
var schedulerOptions = pipeline.DefaultSchedulerOptions with
{  
    InferenceSteps = 28,
    GuidanceScale = 2.5f,
    SchedulerType = SchedulerType.FlowMatchEulerDiscrete,
};

// Run pipeline
var result = await pipeline.GenerateImageAsync(promptOptions, schedulerOptions);

// Save Image Result
await result.SaveAsync("Result.png");

Inference Result

Intro Image