mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
add ideogram prequant and set default schedule
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -290,7 +290,7 @@
|
||||
"date": "2026 May"
|
||||
},
|
||||
"Ideogram 4 sdnq-hadamard-uint4": {
|
||||
"path": "vladmandic/Ideogram-4-sdnq-uint4-hadamard",
|
||||
"path": "Disty0/Ideogram-4-SDNQ-4bit-dynamic-hadamard",
|
||||
"desc": "Ideogram 4 is Ideogram's first open-weight text-to-image model: a two 9.3B flow-matching DiTs that uses a Qwen3-VL vision-language model as its text encoder, with strong in-image text rendering. Requires structured JSON-caption prompts; prompt-enhance (on by default) rewrites a plain prompt into one.",
|
||||
"skip": true,
|
||||
"extras": "sampler: Default, cfg_scale: 7.0, steps: 20, width: 1024, height: 1024",
|
||||
|
||||
@@ -73,8 +73,7 @@ def _patch_scheduler_set_timesteps(scheduler_cls):
|
||||
self,
|
||||
timesteps,
|
||||
)
|
||||
_assign_custom_schedule(self, num_inference_steps, timesteps_array, sigmas_array, device)
|
||||
return
|
||||
return _assign_custom_schedule(self, num_inference_steps, timesteps_array, sigmas_array, device)
|
||||
|
||||
if sigmas is not None:
|
||||
if "sigmas" in set(inspect.signature(scheduler_cls.original_set_timesteps).parameters.keys()):
|
||||
@@ -88,8 +87,9 @@ def _patch_scheduler_set_timesteps(scheduler_cls):
|
||||
**kwargs,
|
||||
)
|
||||
num_inference_steps, timesteps_array, sigmas_array = _prepare_custom_schedule_from_sigmas(self, sigmas, mu=mu)
|
||||
_assign_custom_schedule(self, num_inference_steps, timesteps_array, sigmas_array, device)
|
||||
return
|
||||
return _assign_custom_schedule(self, num_inference_steps, timesteps_array, sigmas_array, device)
|
||||
|
||||
return None
|
||||
|
||||
scheduler_cls.set_timesteps = set_timesteps
|
||||
_patched_schedulers.add(scheduler_cls)
|
||||
@@ -152,7 +152,7 @@ def _compute_timesteps_from_sigmas(scheduler, sigmas_array: np.ndarray) -> np.nd
|
||||
base_sigmas = _get_base_sigmas(scheduler)
|
||||
log_sigmas = np.log(base_sigmas)
|
||||
if hasattr(scheduler, "_sigma_to_t"):
|
||||
sigma_to_t = scheduler._sigma_to_t
|
||||
sigma_to_t = scheduler._sigma_to_t # pylint: disable=protected-access
|
||||
parameters = list(inspect.signature(sigma_to_t).parameters)
|
||||
if len(parameters) == 2:
|
||||
results = []
|
||||
@@ -260,8 +260,8 @@ def _assign_custom_schedule(scheduler, num_inference_steps, timesteps, sigmas, d
|
||||
scheduler.model_outputs = [None] * scheduler.config.solver_order
|
||||
scheduler.lower_order_nums = 0
|
||||
|
||||
scheduler._step_index = None
|
||||
scheduler._begin_index = None
|
||||
scheduler._step_index = None # pylint: disable=protected-access
|
||||
scheduler._begin_index = None # pylint: disable=protected-access
|
||||
scheduler.sigmas = scheduler.sigmas.to("cpu")
|
||||
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ shared_te_map = {
|
||||
'Qwen3-VL 8B SDNQ-UInt4': {
|
||||
'cls': transformers.Qwen3VLModel,
|
||||
'identifier': 'uint4',
|
||||
'target_repo': 'vladmandic/Ideogram-4-sdnq-uint4-hadamard',
|
||||
'target_repo': 'Disty0/Ideogram-4-SDNQ-4bit-dynamic-hadamard',
|
||||
'target_subfolder': 'text_encoder',
|
||||
},
|
||||
'Qwen3-VL 8B Base': {
|
||||
|
||||
@@ -647,6 +647,8 @@ class Ideogram4Pipeline(DiffusionPipeline):
|
||||
# use the provided `guidance_schedule`, validated by `check_inputs`) and the tensor of per-step weights `gw`.
|
||||
if guidance_scale is not None:
|
||||
guidance_schedule = [float(guidance_scale)] * num_inference_steps
|
||||
if guidance_schedule is None:
|
||||
guidance_schedule = [7.0] * int(num_inference_steps * 0.9) + [3.0] * (num_inference_steps - int(num_inference_steps * 0.9)) # 90% of steps with 7.0, last 10% with 3.0
|
||||
gw = torch.as_tensor(guidance_schedule, dtype=torch.float32, device=device)
|
||||
|
||||
# 6. Prepare latents in the packed (B, num_image_tokens, latent_dim) layout.
|
||||
|
||||
Reference in New Issue
Block a user