Spaces:
Running
Running
Anurag181011
commited on
Commit
·
c6897d0
1
Parent(s):
f28e1e9
dfsdfsdffgg
Browse files
app.py
CHANGED
@@ -8,7 +8,6 @@ from PIL import Image
|
|
8 |
SPACE_TITLE = "🎨 Enhanced Studio Ghibli AI Art Generator"
|
9 |
SPACE_DESCRIPTION = "Upload a portrait or a photo and transform it into a breathtaking Studio Ghibli-style masterpiece! Improved model and prompting for better results."
|
10 |
MAIN_MODEL_ID = "nitrosocke/Ghibli-Diffusion"
|
11 |
-
# STYLE_MODEL_ID = "sayakpaul/sd-anime-diff" # Removed the problematic style model
|
12 |
STRENGTH = 0.60 # Adjust for better balance between input and style
|
13 |
GUIDANCE_SCALE = 7.5 # Increased for better prompt adherence
|
14 |
NUM_INFERENCE_STEPS = 30 # Increased for potentially higher quality
|
@@ -50,8 +49,8 @@ if device == "cuda":
|
|
50 |
except Exception as e:
|
51 |
print(f"⚠️ xFormers not available: {e}")
|
52 |
img2img_pipe.enable_model_cpu_offload()
|
53 |
-
|
54 |
-
|
55 |
|
56 |
# --- Image Transformation Function ---
|
57 |
def transform_image(input_image):
|
|
|
8 |
SPACE_TITLE = "🎨 Enhanced Studio Ghibli AI Art Generator"
|
9 |
SPACE_DESCRIPTION = "Upload a portrait or a photo and transform it into a breathtaking Studio Ghibli-style masterpiece! Improved model and prompting for better results."
|
10 |
MAIN_MODEL_ID = "nitrosocke/Ghibli-Diffusion"
|
|
|
11 |
STRENGTH = 0.60 # Adjust for better balance between input and style
|
12 |
GUIDANCE_SCALE = 7.5 # Increased for better prompt adherence
|
13 |
NUM_INFERENCE_STEPS = 30 # Increased for potentially higher quality
|
|
|
49 |
except Exception as e:
|
50 |
print(f"⚠️ xFormers not available: {e}")
|
51 |
img2img_pipe.enable_model_cpu_offload()
|
52 |
+
img2img_pipe.enable_vae_slicing() # Use img2img_pipe here
|
53 |
+
img2img_pipe.enable_attention_slicing() # Use img2img_pipe here
|
54 |
|
55 |
# --- Image Transformation Function ---
|
56 |
def transform_image(input_image):
|