gwiener / stable-diffusion-webui

Stable Diffusion web UI for testing GitHub integrations
GNU Affero General Public License v3.0
0 stars 0 forks source link

[Feature Request]: Resize image after it was generated #2

Open gwiener opened 1 month ago

gwiener commented 1 month ago

Is there an existing issue for this?

What would your feature do ?

If the user changes the image resolution after the image was generated, the image would be resampled and resized

Proposed workflow

  1. Select a resolution
  2. Enter prompts
  3. Generate an image
  4. Change the resolution
  5. Press "resize"

Additional information

No response

issuelinter[bot] commented 1 month ago

To implement the feature where the user can change the image resolution after it has been generated, you will need to make changes in the following files and functions, based on the search results:

  1. modules/images.py

    • Function: resize_image
    • Reason: This function handles the image resizing logic and contains logic for different resize modes.
  2. modules/ui.py

    • Function: img2img_args (in the setup_ui_for_section function)
    • Reason: This configures UI elements and actions, and will need updates to integrate the new "resize" button and its functionality.
  3. modules/upscaler.py

    • Class: Upscaler
    • Reason: The upscale method and related methods/classes like UpscalerLanczos handle the upscaling logic which will be useful for resampling resized images.
  4. modules/img2img.py

    • Function: img2img
    • Reason: This function handles various img2img operations and will need updating to incorporate the new resizing workflow.
  5. scripts/postprocessing_upscale.py

    • Function: process
    • Function: upscale
    • Reason: These functions handle postprocessing and upscaling after image generation, and will also need to be integrated with the new resolution change functionality.

Short Assessment

Scale of Changes: Normal

Reasoning: The changes involve both the backend logic (image resizing and upscaling) and the frontend (UI for the "resize" button and new resolution input). While they span across several functional areas — namely the image processing logic and user interface elements — they do not require a complete overhaul of the entire system. Instead, they are focused on enhancing existing components to support the new functionality.

Proper integration and testing are required, especially to ensure that the image processing works seamlessly after the resolution change and that the UI provides a user-friendly experience when invoking the new feature.

Citations

These references were gathered from a search through the current codebase, ensuring that the proposed changes align with the functions and logic already defined. This will help in smoothly integrating the new feature.