Skip to content

Conversation

stduhpf
Copy link
Contributor

@stduhpf stduhpf commented Aug 6, 2025

Support for models like omni-kontext

How to use:

Download omni-kontext character LoRA and add it to your lora model directory.

example command:
sd.exe --diffusion-model models\flux1-kontext-dev-q5_1.gguf --clip_l models\clip\clip_l\clip_l.safetensors --t5xxl models\clip\t5\t5xxl_fp16.safetensors --vae models\vae\flux\ae.f16.gguf -W 1024 -H 512 -p "Add the character to the scene <lora:character_5000:1>" -r 'scene_02.png' -r 'boy_reference_512.png,2' --cfg-scale 1 --sampling-method euler --color --lora-model-dir models\loras\flux\kontext\

note the ,2 after the path to the second image. That's the desired RoPE index of the character's image (defaults to index 1).

Results:

Background Character
scene_02.png boy_reference_512.png
Without LoRA With omni-kontext character LoRA
master (index 1 for both images, using 2D RoPE offsets) no_lora_no_indices lora_no_indices
PR (index 2 for character) no_lora_indices lora_indices

@leejet
Copy link
Owner

leejet commented Aug 6, 2025

I think it's not necessary to manually assign a number to each ref image. Instead, we can use a single parameter, such as --increase-ref-index, to control whether to increment the index.

@stduhpf
Copy link
Contributor Author

stduhpf commented Aug 6, 2025

I like having the option to set it manually, but you're right, a --increase-ref-index would be more convenient.

@leejet leejet merged commit c587a43 into leejet:master Sep 7, 2025
8 checks passed
@leejet
Copy link
Owner

leejet commented Sep 7, 2025

Thank you for your contribution.

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