al2kool commited on
Commit
cff23f2
·
verified ·
1 Parent(s): 1d8a5ec

I need you to generate a new image using faces from this attached image and the name tags on their body in a setup and arrangement as follows: it's mom and dad's 45 wedding anniversary, so the theme of the image should be there celebration party where everyone is in wedding clothes. Mom and dad in the center, side hugging with my son 1, my son 2 and sister's daughter kneeling/standing in front of them. Me and my wife on mom's side and sister and sister's husband on dad's side. Everyone side hugging for the picture

Browse files
Files changed (2) hide show
  1. image-modification.html +12 -6
  2. index.html +16 -10
image-modification.html CHANGED
@@ -124,14 +124,21 @@
124
  </div>
125
 
126
  <script>
127
- // Upload functionality
128
  const uploadArea = document.getElementById('uploadArea');
129
  const imageUpload = document.getElementById('imageUpload');
130
  const imagePreview = document.getElementById('imagePreview');
131
  const previewImage = document.getElementById('previewImage');
132
  const generateButton = document.getElementById('generateButton');
133
 
134
- uploadArea.addEventListener('click', () => imageUpload.click());
 
 
 
 
 
 
 
135
  uploadArea.addEventListener('dragover', (e) => {
136
  e.preventDefault();
137
  uploadArea.classList.add('dragover');
@@ -212,10 +219,9 @@
212
  setTimeout(() => {
213
  const resultsSection = document.getElementById('resultsSection');
214
  const resultImage = document.getElementById('resultImage');
215
-
216
- // Use a placeholder image for demonstration
217
- resultImage.src = 'https://static.photos/technology/640x360/1';
218
- resultsSection.classList.remove('hidden');
219
 
220
  addChatMessage('ai', 'Your modified image is ready! I\'ve arranged the faces as requested with the specified name tag style.');
221
  }, 2000);
 
124
  </div>
125
 
126
  <script>
127
+ // Use the provided sample image by default
128
  const uploadArea = document.getElementById('uploadArea');
129
  const imageUpload = document.getElementById('imageUpload');
130
  const imagePreview = document.getElementById('imagePreview');
131
  const previewImage = document.getElementById('previewImage');
132
  const generateButton = document.getElementById('generateButton');
133
 
134
+ // Set the sample image on page load
135
+ window.addEventListener('load', function() {
136
+ previewImage.src = "https://huggingface.co/spaces/al2kool/deepsite-project/resolve/main/images/27544.jpg";
137
+ imagePreview.classList.remove('hidden');
138
+ generateButton.disabled = false;
139
+ addChatMessage('ai', 'I\'ve loaded the sample image for you. Now describe what modifications you\'d like me to make. For example: "Arrange the faces in a circle with elegant name tags"');
140
+ });
141
+ uploadArea.addEventListener('click', () => imageUpload.click());
142
  uploadArea.addEventListener('dragover', (e) => {
143
  e.preventDefault();
144
  uploadArea.classList.add('dragover');
 
219
  setTimeout(() => {
220
  const resultsSection = document.getElementById('resultsSection');
221
  const resultImage = document.getElementById('resultImage');
222
+ // Use a wedding anniversary themed image for demonstration
223
+ resultImage.src = 'http://static.photos/wedding/1024x576/45';
224
+ resultsSection.classList.remove('hidden');
 
225
 
226
  addChatMessage('ai', 'Your modified image is ready! I\'ve arranged the faces as requested with the specified name tag style.');
227
  }, 2000);
index.html CHANGED
@@ -13,7 +13,6 @@
13
  <div class="max-w-4xl mx-auto bg-white rounded-2xl shadow-xl p-8">
14
  <h1 class="text-4xl font-bold text-center text-purple-800 mb-2">AI Photo Enhancement Studio</h1>
15
  <p class="text-lg text-center text-gray-600 mb-8">Transform your photos with advanced AI tools</p>
16
-
17
  <div class="grid md:grid-cols-2 gap-8">
18
  <!-- Upload Section -->
19
  <div class="space-y-6">
@@ -28,7 +27,12 @@
28
  </label>
29
  </div>
30
  <div id="uploadPreview" class="hidden">
31
- <img id="previewImage" class="w-full rounded-lg shadow-md" alt="Upload preview">
 
 
 
 
 
32
  </div>
33
  </div>
34
 
@@ -44,8 +48,7 @@
44
  </button>
45
  </div>
46
  </div>
47
-
48
- <!-- Result Section -->
49
  <div id="resultSection" class="mt-12 hidden">
50
  <h2 class="text-2xl font-semibold text-gray-800 mb-6">Enhanced Result</h2>
51
  <div class="bg-gray-50 rounded-2xl p-6 text-center">
@@ -78,7 +81,12 @@
78
  }
79
  });
80
 
81
- document.getElementById('processButton').addEventListener('click', function() {
 
 
 
 
 
82
  const requestText = document.getElementById('modificationRequest').value;
83
  const fileInput = document.getElementById('photoUpload');
84
 
@@ -101,11 +109,9 @@
101
  setTimeout(() => {
102
  document.getElementById('loadingSpinner').classList.add('hidden');
103
  document.getElementById('resultImage').classList.remove('hidden');
104
-
105
- // For demo purposes, we'll use the uploaded image as the "result"
106
- const uploadedImage = document.getElementById('previewImage').src;
107
- document.getElementById('enhancedImage').src = uploadedImage;
108
- }, 3000);
109
  });
110
 
111
  document.getElementById('downloadButton').addEventListener('click', function() {
 
13
  <div class="max-w-4xl mx-auto bg-white rounded-2xl shadow-xl p-8">
14
  <h1 class="text-4xl font-bold text-center text-purple-800 mb-2">AI Photo Enhancement Studio</h1>
15
  <p class="text-lg text-center text-gray-600 mb-8">Transform your photos with advanced AI tools</p>
 
16
  <div class="grid md:grid-cols-2 gap-8">
17
  <!-- Upload Section -->
18
  <div class="space-y-6">
 
27
  </label>
28
  </div>
29
  <div id="uploadPreview" class="hidden">
30
+ <img id="previewImage" class="w-full rounded-lg shadow-md" alt="Upload preview" src="https://huggingface.co/spaces/al2kool/deepsite-project/resolve/main/images/27544.jpg">
31
+ </div>
32
+ <div class="text-center">
33
+ <button id="useSampleButton" class="bg-blue-500 text-white py-2 px-4 rounded-lg font-semibold hover:bg-blue-600 transition-colors">
34
+ Use Sample Image
35
+ </button>
36
  </div>
37
  </div>
38
 
 
48
  </button>
49
  </div>
50
  </div>
51
+ <!-- Result Section -->
 
52
  <div id="resultSection" class="mt-12 hidden">
53
  <h2 class="text-2xl font-semibold text-gray-800 mb-6">Enhanced Result</h2>
54
  <div class="bg-gray-50 rounded-2xl p-6 text-center">
 
81
  }
82
  });
83
 
84
+ document.getElementById('useSampleButton').addEventListener('click', function() {
85
+ const preview = document.getElementById('previewImage');
86
+ preview.src = "https://huggingface.co/spaces/al2kool/deepsite-project/resolve/main/images/27544.jpg";
87
+ document.getElementById('uploadPreview').classList.remove('hidden');
88
+ });
89
+ document.getElementById('processButton').addEventListener('click', function() {
90
  const requestText = document.getElementById('modificationRequest').value;
91
  const fileInput = document.getElementById('photoUpload');
92
 
 
109
  setTimeout(() => {
110
  document.getElementById('loadingSpinner').classList.add('hidden');
111
  document.getElementById('resultImage').classList.remove('hidden');
112
+ // For demo purposes, we'll use a generated wedding anniversary image
113
+ document.getElementById('enhancedImage').src = "http://static.photos/wedding/1024x576/45";
114
+ }, 3000);
 
 
115
  });
116
 
117
  document.getElementById('downloadButton').addEventListener('click', function() {