Giter Club home page Giter Club logo

viewsdimageinnewtab's Introduction

ViewSDimageInNewTab

This guide shows you how to view sd images in a new tab and refresh automagically ( automatic1111 )

Video Demo and Instructions : If you came here from the video, that's great !

  • Edit stable-diffusion-webui\modules\images.py as below
file_path_temp = "E:\git_projx\stable-diffusion-webui\outputs\currimg.png" #change this to whatever you want
image.save(file_path_temp)



  • Save the index.html file ,and edit the path to the image in there accordingly
  • Enjoy !!!!
  • I know this is a fugly way to do it, but until it's added in to automatic1111 webui, you can use this.

viewsdimageinnewtab's People

Contributors

siddharthlh24 avatar

Stargazers

 avatar

Watchers

 avatar

viewsdimageinnewtab's Issues

[Errno 22] Invalid argument , path reading problems

I have tried to get this to work multiple times on both prod and dev installs of A1111.

I am able to create the temp image manually and see it in the HTML page, but the webUI can not create the temp image.

I have the code in my images.py
2024-03-21 10_43_44-E__AI_A1111-Portable Dev_webui_modules_images py - Notepad++

but I get the following error in the consolel:

OSError: [Errno 22] Invalid argument: 'E:\temp\\currimg.png'

Full Message:

*** Error completing request████████████████████████████████▊    | 19/20 [00:02<00:00,  9.84it/s]

*** Arguments: ('task(1r81vzq2xr57es4)', <gradio.routes.Request object at 0x000002CADC76DFF0>, '', '', [], 20, 'Euler a', 1, 1, 7, 704, 512, False, 0.35, 2, '4x Foolhardy Remacri', 15, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], 0, -1, False, -1, 0, 0, 0, False, '', 0.8, UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=64, threshold_a=64, threshold_b=64, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=64, threshold_a=64, threshold_b=64, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=64, threshold_a=64, threshold_b=64, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None), None, False, '0', '0', 'inswapper_128.onnx', 'CodeFormer', 1, True, 'None', 1, 1, False, True, 1, 0, 0, False, 0.5, True, False, 'CUDA', False, 0, 'None', '', None, False, False, 0.5, 0, True, False, False, False, 'base', False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False, None, None, False, None, None, False, None, None, False, 50) {}
    Traceback (most recent call last):
      File "E:\AI\A1111-Portable Dev\webui\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "E:\AI\A1111-Portable Dev\webui\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "E:\AI\A1111-Portable Dev\webui\modules\txt2img.py", line 110, in txt2img
        processed = processing.process_images(p)
      File "E:\AI\A1111-Portable Dev\webui\modules\processing.py", line 792, in process_images
        res = process_images_inner(p)
      File "E:\AI\A1111-Portable Dev\webui\extensions\2-Controlnet\scripts\batch_hijack.py", line 59, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "E:\AI\A1111-Portable Dev\webui\modules\processing.py", line 1023, in process_images_inner
        images.save_image(image, p.outpath_samples, "", p.seeds[i], p.prompts[i], opts.samples_format, info=infotext(i), p=p)
      File "E:\AI\A1111-Portable Dev\webui\modules\images.py", line 615, in save_image
        image.save(file_path_temp)
      File "E:\AI\A1111-Portable Dev\system\python\lib\site-packages\PIL\Image.py", line 2429, in save
        fp = builtins.open(filename, "w+b")
    OSError: [Errno 22] Invalid argument: 'E:\temp\\currimg.png'

---

I don't know what the double backslash is from, as it is not typed that way in the python file.
I also don't get any generated images in my output folder.

I wonder if instead of modifying the image generation script to create a duplicate temp image, we just have the HTML file monitor the output folders and display whatever the newest generated image is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.