SahilCarterr commited on
Commit
2b243d1
·
verified ·
1 Parent(s): d73447c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -12,7 +12,7 @@ from PIL import Image
12
  from matplotlib import pyplot as plt
13
  from diffusers import StableDiffusionInpaintPipeline, ControlNetModel, UniPCMultistepScheduler
14
  from diffusers.utils import load_image
15
-
16
  pipe_sd = StableDiffusionInpaintPipeline.from_pretrained(
17
  "runwayml/stable-diffusion-inpainting",
18
  revision="fp16",
@@ -20,6 +20,7 @@ pipe_sd = StableDiffusionInpaintPipeline.from_pretrained(
20
  )
21
  # speed up diffusion process with faster scheduler and memory optimization
22
  pipe_sd.scheduler = UniPCMultistepScheduler.from_config(pipe_sd.scheduler.config)
 
23
  #pipe_sd.to('cpu')
24
  # load control net and stable diffusion v1-5
25
  from diffusers import StableDiffusionControlNetInpaintPipeline
@@ -30,6 +31,7 @@ pipe = StableDiffusionControlNetInpaintPipeline.from_pretrained(
30
 
31
  # speed up diffusion process with faster scheduler and memory optimization
32
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
 
33
  # remove following line if xformers is not installed
34
  text_prompt="Transform this image into a work of art by changing its style and color palette. Apply a distinct artistic style, such as impressionism, cubism, or surrealism, to give the image a unique and visually striking appearance. Experiment with brush strokes, textures, and effects to achieve the desired artistic effect while maintaining the essence of the original scene. Additionally, adjust the color palette to evoke a specific mood or theme. For example, infuse warm, earthy tones for a rustic and cozy feel, or opt for vibrant, psychedelic colors for a surreal and otherworldly atmosphere. The goal is to reimagine the image in a creative and expressive way, transforming it into a captivating visual masterpiece."
35
  import os
 
12
  from matplotlib import pyplot as plt
13
  from diffusers import StableDiffusionInpaintPipeline, ControlNetModel, UniPCMultistepScheduler
14
  from diffusers.utils import load_image
15
+ from ControlNetInpaint.src import *
16
  pipe_sd = StableDiffusionInpaintPipeline.from_pretrained(
17
  "runwayml/stable-diffusion-inpainting",
18
  revision="fp16",
 
20
  )
21
  # speed up diffusion process with faster scheduler and memory optimization
22
  pipe_sd.scheduler = UniPCMultistepScheduler.from_config(pipe_sd.scheduler.config)
23
+ pipe_sd.enable_xformers_memory_efficient_attention()
24
  #pipe_sd.to('cpu')
25
  # load control net and stable diffusion v1-5
26
  from diffusers import StableDiffusionControlNetInpaintPipeline
 
31
 
32
  # speed up diffusion process with faster scheduler and memory optimization
33
  pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
34
+ pipe.enable_xformers_memory_efficient_attention()
35
  # remove following line if xformers is not installed
36
  text_prompt="Transform this image into a work of art by changing its style and color palette. Apply a distinct artistic style, such as impressionism, cubism, or surrealism, to give the image a unique and visually striking appearance. Experiment with brush strokes, textures, and effects to achieve the desired artistic effect while maintaining the essence of the original scene. Additionally, adjust the color palette to evoke a specific mood or theme. For example, infuse warm, earthy tones for a rustic and cozy feel, or opt for vibrant, psychedelic colors for a surreal and otherworldly atmosphere. The goal is to reimagine the image in a creative and expressive way, transforming it into a captivating visual masterpiece."
37
  import os