muhammadsalmanalfaridzi
commited on
Commit
β’
3804e2c
1
Parent(s):
0fa254e
Update app.py
Browse files
app.py
CHANGED
@@ -44,14 +44,14 @@ def remove_background_bria(input_path):
|
|
44 |
|
45 |
# Fungsi untuk memproses gambar menggunakan prompt
|
46 |
def text_to_image(prompt):
|
47 |
-
image =
|
48 |
image_path = f"generated_images/{prompt.replace(' ', '_')}.png"
|
49 |
image.save(image_path)
|
50 |
return image, image_path
|
51 |
|
52 |
def text_image_to_image(image, prompt):
|
53 |
# Convert input image to PIL Image for processing
|
54 |
-
modified_image =
|
55 |
image_path = f"generated_images/{prompt.replace(' ', '_')}_modified.png"
|
56 |
modified_image.save(image_path)
|
57 |
return modified_image, image_path
|
|
|
44 |
|
45 |
# Fungsi untuk memproses gambar menggunakan prompt
|
46 |
def text_to_image(prompt):
|
47 |
+
image = sd_model(prompt).images[0] # Use sd_model instead of pipe
|
48 |
image_path = f"generated_images/{prompt.replace(' ', '_')}.png"
|
49 |
image.save(image_path)
|
50 |
return image, image_path
|
51 |
|
52 |
def text_image_to_image(image, prompt):
|
53 |
# Convert input image to PIL Image for processing
|
54 |
+
modified_image = sd_model(prompt, init_image=image, strength=0.75).images[0] # Use sd_model here too
|
55 |
image_path = f"generated_images/{prompt.replace(' ', '_')}_modified.png"
|
56 |
modified_image.save(image_path)
|
57 |
return modified_image, image_path
|