Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,8 @@ matplotlib.use('Agg') # Set backend BEFORE importing pyplot or other conflicting
|
|
| 5 |
|
| 6 |
import gradio as gr
|
| 7 |
import torch
|
| 8 |
-
from diffusers import
|
|
|
|
| 9 |
from PIL import Image, ImageOps # Added ImageOps for inversion
|
| 10 |
import numpy as np
|
| 11 |
import os
|
|
@@ -146,7 +147,7 @@ def generate_image(drawing_input, prompt, fidelity_slider, steps, guidance, imag
|
|
| 146 |
# Invert the image: White bg -> Black bg, Black lines -> White lines
|
| 147 |
input_image_inverted = ImageOps.invert(input_image_pil)
|
| 148 |
#save the inverted image
|
| 149 |
-
input_image_inverted.save("input_image_inverted.png")
|
| 150 |
|
| 151 |
# Ensure image is 512x512
|
| 152 |
if input_image_inverted.size != (512, 512):
|
|
|
|
| 5 |
|
| 6 |
import gradio as gr
|
| 7 |
import torch
|
| 8 |
+
from diffusers import EulerAncestralDiscreteScheduler
|
| 9 |
+
from DoodlePix_pipeline import StableDiffusionInstructPix2PixPipeline
|
| 10 |
from PIL import Image, ImageOps # Added ImageOps for inversion
|
| 11 |
import numpy as np
|
| 12 |
import os
|
|
|
|
| 147 |
# Invert the image: White bg -> Black bg, Black lines -> White lines
|
| 148 |
input_image_inverted = ImageOps.invert(input_image_pil)
|
| 149 |
#save the inverted image
|
| 150 |
+
# input_image_inverted.save("input_image_inverted.png")
|
| 151 |
|
| 152 |
# Ensure image is 512x512
|
| 153 |
if input_image_inverted.size != (512, 512):
|