Skip to content

Support for ref images RoPE index (omni-kontext) #755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

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.

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