Skip to content

Conversation

@Aatricks
Copy link
Owner

Summary

Ensure HiresFix runs against the base model after a refiner swap and add a collection of stability fixes, frontend settings/history features, and comprehensive tests to prevent regressions.

Key changes by theme

Pipeline / HiresFix

  • Reload the base model before HiresFix when a refiner was used to prevent AttributeError / invalid model state.
  • Files: Pipeline.py, HiresFix.py
  • Tests: integration coverage added for refiner → hires flow.

VAE & ADetailer (stability)

  • Fixed GPU→CPU race in VariationalAE.encode() (use blocking transfer). (VariationalAE.py)
  • Ensure ADetailer uses the base model for post-processing and round VAE resize dims to multiples of 8. (ADetailer.py)

Flux2 / Latent handling

  • RoPE / transformer token-grid assertions and per-chunk fallback on mismatch.
  • Patchify padding for odd VAE latent dims to avoid reshape errors. (src/NeuralNetwork/flux2/*, Latent.py)
  • Added targeted unit tests.

Downloader & File validation

  • Require model artifact files (safetensors/pt/pth) for Flux2 checks and add downloader tests. (Downloader.py, test_downloader.py)

Frontend: settings history & metadata import

  • Persist/load generation settings and add "Import settings from image" UI. (GenerationSettings.tsx, client.ts, useStore.ts)
  • Add server API support for last-seed and settings history. (server.py, SettingsStore.py)

Docs & installation

  • Document batch/image limits and lcms2 installation for AutoHDR color transforms. (docs/*.md)

Tests / Test-restructure

  • Reorganized tests (unit/integration/e2e), added many new tests to guard these fixes. (tests/**)

Reverted to original:
- Attention.py: removed SDXL-specific code and mask param addition
- SDXLModel.py: restored unconditional HiDiffusion application
- upscale.py: restored bislerp implementation
- Clip.py: restored original fallback behavior
- cond.py: removed extra pooled_output from model_conds
- ModelBase.py: restored original sdxl_pooled function

ADetailer fixes remain intact:
- crop_cond with SDXL size conditioning
- noise_mask_feather=0 (prevents DifferentialDiffusion mask destruction)
- SDXL-aware guide_size/max_size/denoise
- Original positive conditioning passed through pipeline
…ting

- Fix VAE encode GPU->CPU race condition (non_blocking=True -> blocking transfer)
  matching the pattern already used in decode(). Without this fix, VAE-encoded
  latents become all zeros after refiner model swap.
- Ensure ADetailer always uses base model, not refiner, in all Pipeline methods
  (run, run_batched, run_img2img, run_controlnet). Refiner model is not suited
  for text-guided crop enhancement.
- Remove diagnostic print statements from Adetailer.py
- Added LD_MAX_IMAGES_PER_GROUP to control maximum images processed in a single pipeline run.
- Enhanced GenerationBuffer to chunk requests exceeding LD_MAX_IMAGES_PER_GROUP and ImageSaver.MAX_IMAGES_PER_SAVE.
- Updated AutoHDR to handle RGBA images and preserve alpha channels.
- Improved ImageSaver to respect runtime configuration for MAX_IMAGES_PER_SAVE via environment variable.
- Introduced comprehensive tests for chunking behavior, ensuring proper handling of large requests and image saving limits.
- Added telemetry to report max_images_per_group in server status.
… mismatches input; add RoPE seq-length assert and tests
…RoPE feature dimension check and padding adjustments in Flux2 model
…endpoints for last seed and settings history; update UI components to utilize new features
@Aatricks Aatricks self-assigned this Feb 12, 2026
@Aatricks Aatricks merged commit 68e4dbd into main Feb 12, 2026
0 of 2 checks passed
@Aatricks Aatricks deleted the fix/hiresfix-reload-base-after-refiner branch February 12, 2026 14:35
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.

1 participant