Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature add DyPE support (experimental)#941

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
stduhpf wants to merge3 commits intoleejet:master
base:master
Choose a base branch
Loading
fromstduhpf:dype

Conversation

@stduhpf
Copy link
Contributor

@stduhpfstduhpf commentedNov 5, 2025
edited
Loading

https://github.com/guyyariv/DyPE/tree/master

Flux only for now, I don't have enough VRAM to test it at very high resolutions (seems to be working at 1536x1536 resolution, but it should be tested at up to 4096x4096 to be completely sure it's working as intended)

Use env vraiables to enable it:

  • FLUX_ROPE =DY_YARN,DY_NTK,YARN, orNTK (any other value will use standard RoPE)
  • FLUX_DYPE_BASE_RESOLUTION (defaults to1024 which should be best for base Flux,maybe use512 for Chroma? (untested yet)768 seems to work for Chroma, for some reason512 didn't perform well at all in my testing, maybe use1024 too)

Example:

.\build\bin\sd.exe --diffusion-model ..\ComfyUI\models\unet\Flux\dev\flux1-dev-Q3_k.gguf --t5xxl ..\ComfyUI\models\clip\t5\t5xxl_q8_0.gguf --clip_l ..\ComfyUI\models\clip\clip_l\clip_l.safetensors --vae ..\ComfyUI\models\vae\flux\ae.safetensors -p "a lovely cat holding a sign says 'Flux cpp'" --cfg-scale 1 --sampling-method euler -W 1536 -H 1536 --vae-tiling --vae-tile-size 64

(base resolution 1024)

default RoPEDY_YARNDY_NTKYARNNTK
outputoutputoutputoutputoutput

Green-Sky and fszontagh reacted with thumbs up emoji
@stduhpf
Copy link
ContributorAuthor

Test with Flux Schnell q3_k at 1792x1792 (biggest I could acheive using shared video memory without crashing), 6 steps

defaultDY_YARN
outputoutput

(doesn't look very lovely, but it makes a better use of the available image area I guess?)

Green-Sky reacted with laugh emoji

@fszontagh
Copy link
Contributor

Test with Flux Schnell q3_k at 1792x1792 (biggest I could acheive using shared video memory without crashing), 6 steps

How much video memory do you have?

@stduhpf
Copy link
ContributorAuthor

stduhpf commentedNov 7, 2025
edited
Loading

How much video memory do you have?

16GB VRAM + 16GB shared memory. But I no longer think the crash is related to OOM issues. Rocm backend just crashes at high resolution (#948).Maybe I should try again with Vulkan Of course Vulkan won't work either, because buffer size limit

@Green-Sky
Copy link
Contributor

Green-Sky commentedNov 7, 2025
edited
Loading

Just wanted you to try a smaller model, just to add a little more headroom,but my ggufs keep crashing on loading, even without the last commit 🙈 I am stupid, I just forgot--clip-on-cpu .
eg:https://huggingface.co/Green-Sky/flux.1-lite-8B-GGUF/blob/main/lora-experiments/hyper-flux.1-lite-8B-8step-q5_k.gguf

@stduhpf
Copy link
ContributorAuthor

@Green-Sky I get the same crash at over 1792x1792, even with a tiny model likehttps://huggingface.co/Green-Sky/flux-mini-GGUF/blob/main/flux-mini-q4_k.gguf

@Green-Sky
Copy link
Contributor

Green-Sky commentedNov 7, 2025
edited
Loading

I can generate 2048x1024 without problems(?), but when I try 3072x1024 it runs but always returns a black image (???).

Here is 2048x1024 without any rope manipulation:
fl_noyarn_2048x1024_1

and here with YARN (defaults):
fl_yarn_2048x1024_1

stduhpf reacted with thumbs up emoji

@stduhpf
Copy link
ContributorAuthor

stduhpf commentedNov 7, 2025
edited
Loading

Wait, I forgot about--diffusion-fa. I can run 2048x2048 just fine by enabling it.

Well "fine", but still slow, with about 7GB vram to spare still

4096x4096 yieldsstable-diffusion.cpp/ggml/src/ggml-cuda/cpy.cu:258: GGML_ASSERT(ggml_nbytes(src0) <= INT_MAX) failed

Green-Sky reacted with laugh emoji

@stduhpf
Copy link
ContributorAuthor

Shnell q4_k 6steps, 2048x2048, with fa enabled

defaultDY_YARN
output - Copy (123)output - Copy (122)

Neither are looking good, but the one with dype at least has a cat in it?

Green-Sky reacted with thumbs up emoji

@stduhpf
Copy link
ContributorAuthor

stduhpf commentedNov 7, 2025
edited
Loading

Not sure if it's because of flash attention or if there's a bug somewhere, But I can't get any good results at high resolution, either with or without dype. Since I'm using previews, I can see that the first step generally looks okay-ish, but it gets darker and less detailed at every subsequent step.

High resolution results look the same kind of broken as when using CFG with Flux (blurry, overly contrasted and so on), But i double checked that CFG is not enabled.

@leejet
Copy link
Owner

I’m not sure whether generating ultra-high-resolution images would cause problems for models that weren’t specifically trained for that purpose — for example, internal NaNs. Previously, I tried using relatively large images as context inputs, which ended up producing black images, while using lower-resolution inputs worked fine.

stduhpf and Green-Sky reacted with eyes emoji

@stduhpf
Copy link
ContributorAuthor

stduhpf commentedNov 7, 2025
edited
Loading

It looks like it's inducing some (slight) distorsions on non-square resolutions, maybe the "base resolution" should be made aware of the targeted aspect ratio...

Green-Sky reacted with thumbs up emoji

@stduhpf
Copy link
ContributorAuthor

Not sure if it's because of flash attention or if there's a bug somewhere, But I can't get any good results at high resolution, either with or without dype. Since I'm using previews, I can see that the first step generally looks okay-ish, but it gets darker and less detailed at every subsequent step.

High resolution results look the same kind of broken as when using CFG with Flux (blurry, overly contrasted and so on), But i double checked that CFG is not enabled.

This doesn't seem to happen with Vulkan btw, ROCm only.
@Green-Sky Which backend did you use for your 2048x1024 gens?

@Green-Sky
Copy link
Contributor

Green-Sky commentedNov 7, 2025
edited
Loading

This doesn't seem to happen with Vulkan btw, ROCm only.@Green-Sky Which backend did you use for your 2048x1024 gens?

CUDA on my rtx 2070 (8gig). The model I linked looked fine, and I think slightly better without rope scaling at that resolution.
edit: though it is a single example, but I think the vertical stripes are stronger with rope scaling (YaRN).

@stduhpf
Copy link
ContributorAuthor

stduhpf commentedNov 7, 2025
edited
Loading

CUDA on my rtx 2070 (8gig)

Ok, so it seem like it's a ROCm specific issue. For context, generating at 2048x1024 with Flux on my ROCm build spits out somethig like this, regardless of the RoPE modifications:
output

Vulkan works, but it's very slow, here's a preview of the 2048x1536 that it's currently generating at 158.96s/it with dy-yarn enabled:

preview

I got a driver timeout when I tried 2048x2048 on Vulkan.

Green-Sky reacted with eyes emoji

@stduhpf
Copy link
ContributorAuthor

stduhpf commentedNov 9, 2025
edited
Loading

It will now by default pick a base resolution with a similar aspect ratio and a pixel count close toFLUX_DYPE_BASE_RESOLUTION ² pixels, unless you specify the exact desired dimensions of the base resolution withFLUX_DYPE_BASE_RESOLUTION={Width}x{Height}

This seems to fix the distorsion issue completely, here's an example with a 1024x2048 using dy_yarn:

No dypeDype 1024x1024 (old)dype 724x1448 (1024 auto)bonus: 1448x724 (oops)
outputoutput - Copy (137)output - Copy (135)output - Copy (136)
Green-Sky reacted with thumbs up emojiGreen-Sky reacted with laugh emoji

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@stduhpf@fszontagh@Green-Sky@leejet

[8]ページ先頭

©2009-2025 Movatter.jp