super resolution use python

#8
by Vladislav-ml - opened

pipeline = DiffusionPipeline.from_pretrained("TTPlanet/TTPLanet_SDXL_Controlnet_Tile_Realistic")```

The proposed diffuser design doesn't work for me.


Maybe there is an example of using an approach in pure python, like:

from diffusers import ControlNetModel, DiffusionPipeline
import torch

controlnet = ControlNetModel.from_pretrained(
    "ValouF-pimento/ControlNet_SDXL_tile_upscale",
    torch_dtype=torch.float16,
    use_safetensors=True,
    variant="fp16",
)

pipe = DiffusionPipeline.from_pretrained(
    'RunDiffusion/Juggernaut-X-v10',
    custom_pipeline="stable_diffusion_controlnet_img2img",
    controlnet=controlnet,
    requires_safety_checker=False,
    safety_checker=None
).to('cuda')

condition_image = resize_for_condition_image(Image.open('test.png'), 1024)
image = pipe(
    prompt="hires, a topless man",
    negative_prompt="blur, lowres, bad anatomy, bad hands, cropped, worst quality",
    image=condition_image,
    controlnet_conditioning_image=condition_image,
    width=512,
    height=512,
    strength=0.25,
    num_inference_steps=32,
    ).images[0]
image.save('1.jpg')

Sign up or log in to comment