Skip to content

Conversation

@b-sai
Copy link
Contributor

@b-sai b-sai commented May 8, 2025

What does this PR do?

This pull request refactors the RegionalPromptingStableDiffusionPipeline class to inherit from the DiffusionPipeline class rather than the StableDiffusionPipeline class

I tested it on the examples here and it is replicating similar images

Fixes issue #6984

Before submitting

cc: @yiyixuxu

@asomoza
Copy link
Member

asomoza commented May 12, 2025

Hi @b-sai, thanks for the PR, can you please post an example with the images to ensure that this works? With this I mean to make sure that each region uses the corresponding prompt, it can be an easy one like a some geometrical figures with colors.

@b-sai
Copy link
Contributor Author

b-sai commented May 19, 2025

Hi @asomoza thanks so much for looking at this! Here I have attached two images.

Current Pull Request

image

Original

image

Code:

    rp_args = {
        "mode":"rows",
        "div": "1,2,1,1;2,4,6"
    }

    prompt = """
    blue sky BREAK
    green hair BREAK
    book shelf BREAK
    terrarium on the desk BREAK
    orange dress and sofa
    """
    pipe = RegionalPromptingStableDiffusionPipeline.from_pretrained("ckpt/anything-v3.0", safety_checker = None, requires_safty_checker = None)
    pipe.to("cuda")
    images = pipe(
        prompt=prompt,
        guidance_scale=7.5,
        height=512,
        width=768,
        num_inference_steps=20,
        num_images_per_prompt=1,
        rp_args=rp_args
        ).images

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@asomoza
Copy link
Member

asomoza commented May 20, 2025

@bot /style

@github-actions
Copy link
Contributor

Style fixes have been applied. View the workflow run here.

@asomoza
Copy link
Member

asomoza commented May 20, 2025

thanks!

@asomoza asomoza merged commit ba8dc7d into huggingface:main May 20, 2025
@DN6 DN6 added the roadmap Add to current release roadmap label Jun 5, 2025
@DN6 DN6 moved this from In Progress to Done in Diffusers Roadmap 0.36 Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmap Add to current release roadmap

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants