feat: support guidance_schedule#1684
Open
stduhpf wants to merge 5 commits into
Open
Conversation
Contributor
Maybe it could be provided as a fraction of the total number of steps, as with We could even support both styles: integers for an exact number, floating point for a fraction. |
Contributor
Author
|
There are plenty of possible ways to implement it, it could also be based on the sigma values like the |
4957da2 to
5512523
Compare
5512523 to
ee5f8cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supports a new
guidance_scheduleparameter (under--extra-sample-args) to improve Ideogram4 support. This could also benefit other models.What it does: Allows the guidance (CFG scale) to change throughout the denoising process. For example, you can use lower guidance values during the final "polishing" steps to help reduce artifacts.
Format:
<steps>x<guidance>[+<steps>x<guidance>...]Examples:
30x7.5→ use CFG scale7.5for the final 30 denoising steps.10x5.0+20x7.5→ use CFG scale5.0for the last 10 steps, and7.5for the 20 steps before that.10x4+10x6+10x8→ use CFG scale4for the last 10 steps,6for the preceding 10 steps, and8for the 10 steps before that.Note: The schedule is applied in reverse order: the first entry corresponds to the final denoising steps, not the initial ones.
If the schedule contains fewer entries than the total number of denoising steps, the regular CFG scale parameter is used for the remaining earlier steps. If it contains more entries than there are denoising steps, the extra entries are ignored.
Related Issue / Discussion
N/A
Additional Information
Recommended Values for Ideogram4 (source: https://github.com/ideogram-oss/ideogram4/blob/main/src/ideogram4/sampler_configs.py)
3x3.0+45x7.02*3.0+18*7.01*3.0+11*7.0(since 7.0 is the default CFG scale, you can get away with just
Nx3.0and the rest will be padded with7.0anyways)Examples: (generated with #1669 also applied)
Commands used
.\buildhip\bin\sd-cli.exe -h --diffusion-model ..\ComfyUI\models\unet\Ideogram\ideogram4-Q8_0.gguf --uncond-diffusion-model ..\ComfyUI\models\unet\Ideogram\ideogram4_unconditional-iQ4_NL.gguf --llm ..\ComfyUI\models\llm\Qwen\Qwen3-VL-8B-Instruct-Q4_K_M.gguf --vae ..\ComfyUI\models\vae\flux\full_encoder_small_decoder.safetensors --diffusion-fa -v --color --offload-to-cpu -W 1024 -H 1536 --preview proj --steps 20 --extra-sample-args "guidance_schedule=2x3" -p --% "{\"aspect_ratio\":\"2:3\",\"high_level_description\":\"An abstract, dreamlike digital illustration of Hatsune Miku surrounded by swirling energy and power elements in a vibrant blue color palette.\",\"compositional_deconstruction\":{\"background\":\"An abstract, ethereal void filled with deep indigo and electric blue gradients, featuring floating geometric shards, swirling energy ribbons, and soft bokeh particles that create a sense of weightless, dreamlike depth.\",\"elements\":[{\"type\":\"obj\",\"bbox\":[120,250,880,750],\"desc\":\"Hatsune Miku, depicted with delicate linework. She has long, wind-swept teal twin-tails flowing dynamically around her. Her eyes feature striking white pupils against a vivid blue iris. She wears her signature futuristic grey and teal outfit with glowing accents, her expression one of focused intensity.\"},{\"type\":\"obj\",\"bbox\":[450,400,600,550],\"desc\":\"A sleek, futuristic silver and teal microphone held close to Miku's mouth, emitting small arcs of blue electricity.\"},{\"type\":\"obj\",\"bbox\":[100,100,900,900],\"desc\":\"Swirling power elements consisting of jagged electric bolts and flowing neon-blue energy ribbons that spiral around the central figure, emphasizing a sense of raw energy and movement.\"}]}}"\buildhip\bin\sd-cli.exe --diffusion-model ..\ComfyUI\models\unet\Ideogram\ideogram4-Q8_0.gguf --uncond-diffusion-model ..\ComfyUI\models\unet\Ideogram\ideogram4_unconditional-iQ4_NL.gguf --llm ..\ComfyUI\models\llm\Qwen\Qwen3-VL-8B-Instruct-Q4_K_M.gguf --vae ..\ComfyUI\models\vae\flux\full_encoder_small_decoder.safetensors --diffusion-fa -v --color --offload-to-cpu -W 1024 -H 1024 --preview proj --steps 12 --extra-sample-args "mu=0.5,std=1.75;guidance_schedule=1x3" -p --% "{\"high_level_description\":\"A square 1024 x 1024 luxury fashion magazine cover featuring exactly one short chubby fluffy cat as the main model. The cat sits on a soft ivory studio floor, facing the viewer with a stylish calm expression, wearing tiny black sunglasses, a red silk scarf, and a small gold collar charm. In front of the cat on the floor is a wide horizontal luxury nameplate that clearly reads ideogram4.cpp. The whole design feels premium, fashionable, clean, and editorial.\",\"style_description\":{\"aesthetics\":\"luxury fashion magazine cover, high-end pet couture campaign, minimalist editorial design, elegant studio photography, soft paper texture, refined typography, fashionable and polished\",\"lighting\":\"Soft diffused studio lighting, gentle spotlight on the cat, subtle floor shadow, warm ivory highlights, clean separation between subject and background\",\"photo\":\"high-resolution fashion editorial photography look, front-facing cat portrait, crisp fur details, glossy sunglasses, clear readable nameplate text, shallow depth of field\",\"medium\":\"mixed media fashion photography and premium editorial graphic design\",\"color_palette\":[\"#F4EFE7\",\"#111111\",\"#D8B56D\",\"#B73A3A\",\"#FFFFFF\",\"#8A7A6A\"]},\"compositional_deconstruction\":{\"canvas\":\"Square 1024 x 1024 canvas with a normal upright orientation. Do not rotate the poster or any text. Use a clean fashion magazine cover layout.\",\"background\":\"Warm ivory studio backdrop with subtle paper grain, a soft spotlight gradient, faint floor shadow, and a few minimal gold editorial lines. The background is spacious, premium, and uncluttered.\",\"layout\":\"Top center has a small elegant headline. Center area features one cat as the main fashion model. Lower foreground has a wide horizontal luxury nameplate placed on the floor in front of the cat. Bottom center has a small footer. All text is horizontal, upright, and readable left to right.\",\"elements\":[{\"type\":\"text\",\"desc\":\"Top center headline reading LOOK WHAT I FOUND in a refined high-fashion serif font. The headline is horizontal, centered, elegant, and secondary to the nameplate text.\"},{\"type\":\"obj\",\"desc\":\"Exactly one short chubby fluffy cat sitting in the center like a luxury fashion model. The cat has a large round head, compact body, short legs, soft detailed fur, expressive eyes, and a calm confident pose. The cat is cute and rounded, not tall, not stretched, not duplicated.\"},{\"type\":\"obj\",\"desc\":\"Tiny glossy black sunglasses worn naturally by the cat, slightly oversized but still showing the cat face clearly. The sunglasses add a chic fashion-editorial attitude.\"},{\"type\":\"obj\",\"desc\":\"A red silk scarf tied neatly around the cat neck, with soft folds and a couture feeling. The scarf must not cover the cat face or the nameplate.\"},{\"type\":\"obj\",\"desc\":\"A small gold collar charm or fashion accessory under the scarf, subtle and premium, adding a luxury campaign detail.\"},{\"type\":\"obj\",\"desc\":\"In the lower foreground, place a wide horizontal luxury nameplate on the floor in front of the cat. The nameplate is low, flat, landscape-oriented, much wider than tall, like a fashion show seat card or premium display plaque. It is centered, front-facing, level, and fully visible. It must not become vertical, tall, standing, rotated, or side-facing.\"},{\"type\":\"text\",\"desc\":\"Print the exact text ideogram4.cpp only on the wide horizontal nameplate. Use clean bold black lettering, perfectly spelled, lowercase, with the number 4 and .cpp extension. The text must fit completely inside the nameplate, stay horizontal, and be readable from left to right.\"},{\"type\":\"obj\",\"desc\":\"Add sparse premium editorial accents around the edges: thin gold lines, small code brackets, tiny cursor marks, subtle dots, and minimal geometric details. No extra cats, no stickers, no animal faces, no busy decorations.\"},{\"type\":\"text\",\"desc\":\"Bottom center footer reading tiny paws, big compile energy in a small refined monospace or editorial font. The footer is horizontal, centered, understated, and much smaller than the nameplate text.\"}]}}"Checklist