Image Detection Bypass Utility
A polished PyQt5 GUI for the image_postprocess pipeline that adds live previews, an input/output analysis panel, an optional camera simulator, and easy parameter control β all wrapped in a clean, user-friendly interface.
Features
- Select input, optional reference, and output paths with live previews.
- Auto Mode: one slider to control an expressive preset of postprocess parameters.
- Manual Mode: full access to noise, CLAHE, FFT, phase perturbation, pixel perturbation, etc.
- Camera pipeline simulator: Bayer/demosaic, JPEG cycles/quality, vignette, chromatic aberration, motion blur, hot pixels, read-noise, banding.
- Input / output analysis panels (via
AnalysisPanel) to inspect images before/after processing. - Background worker thread with progress reporting and rich error dialog (traceback viewer).
- Graceful handling of
image_postprocessimport errors (shows a critical dialog with the import error).
Quick start
ComfyUI Integration
Use ComfyUI Manager and install via GitHub link. Or manually clone to custom_nodes folder.
git clone https://github.com/PurinNyova/Image-Detection-Bypass-Utility
then
cd Image-Detection-Bypass-Utility
pip install -r requirements.txt
Thanks to u/Race88 for the help on the ComfyUI code.
Requirements
- Python 3.8+ recommended
- PyPI packages:
pip install pyqt5 pillow numpy matplotlib piexif
# optional but recommended for color matching / some functionality:
pip install opencv-python
OR
pip install -r requirements.txt
Files expected in the same folder
image_postprocess.pyβ your processing logic (exportprocess_image(...)or compatible API).worker.pyβ Worker thread wrapper used to run the pipeline in background.analysis_panel.pyβ UI widget used for input/output analysis.utils.pyβ must provideqpixmap_from_path(path, max_size=(w,h)).
Run
Save the GUI script (for example) as image_postprocess_gui.py (or use the existing name image_postprocess_gui_with_analysis_updated.py) and run:
python3 image_postprocess_gui.py
If image_postprocess cannot be imported, the GUI will show an error explaining the import failure (see Troubleshooting below).
Using the GUI (at-a-glance)
- Choose Input β opens file dialog; sets suggested output path automatically.
- (optional) Choose Reference β used for FFT/color reference (OpenCV-based color match supported).
- Choose Output β where processed image will be written.
- Auto Mode β enable for a single slider to control a bundled preset.
- Manual Mode β tune individual parameters in the Parameters group.
- Camera Simulator β enable to reveal camera-specific controls (Bayer, JPEG cycles, vignette, chroma, etc.).
- Click Run β Process Image to start. The GUI disables controls while running and shows progress.
- When finished, the output preview and Output analysis panel update automatically.
Parameters / Controls β args mapping
When you click Run, the GUI builds a lightweight argument namespace (similar to a SimpleNamespace) and passes it to the worker. Below are the important mappings used by the GUI (so you know what your process_image should expect):
args.noise_stdβ Gaussian noise STD (fraction of 255)args.clahe_clipβ CLAHE clip limitargs.tileβ CLAHE tile sizeargs.cutoffβ Fourier cutoff (0.01β1.0)args.fstrengthβ Fourier strength (0β1)args.phase_perturbβ phase perturbation STD (radians)args.randomnessβ Fourier randomness factorargs.perturbβ small pixel perturbationsargs.fft_modeβ one ofauto,ref,modelargs.fft_alphaβ alpha exponent for 1/f model (used whenfft_mode=='model')args.radial_smoothβ radial smoothing bins for spectrum matchingargs.jpeg_cyclesβ number of lossy JPEG encode/decode cycles (camera sim)args.jpeg_qmin,args.jpeg_qmaxβ JPEG quality range used by camera simargs.vignette_strengthβ vignette intensity (0β1)args.chroma_strengthβ chromatic aberration strength (pixels)args.iso_scaleβ exposure multiplier (camera sim)args.read_noiseβ read noise in DN (camera sim)args.hot_pixel_probβ probability of hot pixels (camera sim)args.banding_strengthβ banding strengthargs.motion_blur_kernelβ motion blur kernel sizeargs.seedβ integer seed orNonewhen seed==0 in UIargs.sim_cameraβ bool: run camera simulation pathargs.no_no_bayerβ toggles Bayer/demosaic (True = enable RGGB demosaic)args.fft_refβ path to reference image (string) orNone
Tip: Your
process_image(inpath, outpath, args)should be tolerant of missing keys (usegetattr(args, 'name', default)), or accept the sameSimpleNamespaceobject the GUI builds.
Error handling / UI behavior
- The GUI uses a
Workerthread to avoid blocking the UI. Worker emits signals:started,finished(outpath),error(msg, traceback_text). - On error, a dialog displays the error message and a full traceback for debugging.
- If
image_postprocessfails to import at startup, a critical dialog shows the exception details; fix the module or dependencies and restart.
Development notes
- Integrating your pipeline: make sure
image_postprocess.pyexports aprocess_image(inpath, outpath, args)function (or adaptworker.pyto match your pipeline signature). - Analysis panels:
AnalysisPanelshould provideupdate_from_path(path); used for both input and output. - Preview helper:
utils.qpixmap_from_pathis used to load scaled QPixmap for previews β useful for keeping UI responsive. - Packaging: If you want a single executable, consider
PyInstaller(note: includeworker.py,analysis_panel.py,utils.py, and the pipeline module).
Troubleshooting
- ImportError for
image_postprocessβ ensureimage_postprocess.pyis in the same directory or onPYTHONPATH. Also confirm required packages (numpy, Pillow, opencv) are installed. The GUI shows the import error text at startup. - Previews blank/no image β check that
qpixmap_from_pathreturns a valid QPixmap. The preview widget falls back toNo imageif file missing. - Processing hangs β confirm Worker is implemented to emit
finishedorerror. If yourprocess_imageblocks indefinitely, the GUI will appear unresponsive (worker runs in background thread but won't return). - Color matching unavailable β color matching uses OpenCV; if you did not install
opencv-python, the GUI will still run, but reference-based color matching will be disabled.
Example: minimal process_image signature
# image_postprocess.py (sketch)
def process_image(inpath: str, outpath: str, args):
# args is a SimpleNamespace with attributes described above
# load image (PIL / numpy), run your pipeline, save output
pass
Contributing
- PRs welcome. If you modify UI layout or parameter names, keep the
argsmapping consistent or updateREADMEandworker.pyaccordingly. - Add unit tests for
worker.pyand the parameter serialization if you intend to refactor.
License
MIT β free to use and adapt. Please include attribution if you fork or republish.