Spaces:
Running
Running
ItzRoBeerT
commited on
Commit
•
36af654
1
Parent(s):
3957fb5
Upload 2 files
Browse files- dom.py +43 -0
- examples/pigeon.webp +0 -0
dom.py
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
generate_title = """
|
2 |
+
function createGradioAnimation() {
|
3 |
+
var container = document.createElement('div');
|
4 |
+
container.id = 'gradio-animation';
|
5 |
+
container.style.fontSize = '2em';
|
6 |
+
container.style.fontWeight = 'bold';
|
7 |
+
container.style.textAlign = 'center';
|
8 |
+
container.style.marginBottom = '20px';
|
9 |
+
var text = 'Generate Pigeon Avatar';
|
10 |
+
for (var i = 0; i < text.length; i++) {
|
11 |
+
(function(i){
|
12 |
+
setTimeout(function(){
|
13 |
+
var letter = document.createElement('span');
|
14 |
+
letter.style.opacity = '0';
|
15 |
+
letter.style.transition = 'opacity 0.5s';
|
16 |
+
letter.innerText = text[i];
|
17 |
+
container.appendChild(letter);
|
18 |
+
setTimeout(function() {
|
19 |
+
letter.style.opacity = '1';
|
20 |
+
}, 50);
|
21 |
+
}, i * 250);
|
22 |
+
})(i);
|
23 |
+
}
|
24 |
+
var gradioContainer = document.querySelector('.gradio-container');
|
25 |
+
gradioContainer.insertBefore(container, gradioContainer.firstChild);
|
26 |
+
return 'Animation created';
|
27 |
+
}
|
28 |
+
"""
|
29 |
+
|
30 |
+
generate_markdown = """
|
31 |
+
## About this Demo
|
32 |
+
|
33 |
+
This demo generates a pigeon avatar based on an image of a pigeon.
|
34 |
+
|
35 |
+
## How this works?
|
36 |
+
You can upload an image of a pigeon and select an avatar style. The model will generate two pigeons avatars based on the image description.
|
37 |
+
Estimated time: 178s
|
38 |
+
|
39 |
+
**Models used:**
|
40 |
+
|
41 |
+
- [Moondream2](https://huggingface.co/vikhyatk/moondream2) for image description.
|
42 |
+
- [FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev) for image generation (API).
|
43 |
+
"""
|
examples/pigeon.webp
ADDED