|
import gradio as gr |
|
|
|
model = gr.load("models/black-forest-labs/FLUX.1-schnell") |
|
|
|
with gr.Blocks(css=""" |
|
.debug-info { |
|
display: none; |
|
padding: 10px; |
|
background: #f0f0f0; |
|
margin: 10px 0; |
|
} |
|
""") as demo: |
|
model.render() |
|
|
|
|
|
gr.Markdown(""" |
|
<div class="debug-info" id="debug-info"></div> |
|
<script> |
|
function setDefaultText() { |
|
// 尝试不同的选择器来定位输入框 |
|
const textareas = document.querySelectorAll('textarea'); |
|
const inputs = document.querySelectorAll('input[type="text"]'); |
|
const debugInfo = document.getElementById('debug-info'); |
|
|
|
// 调试信息 |
|
let info = `找到 ${textareas.length} 个textarea和 ${inputs.length} 个text input\n`; |
|
|
|
// 尝试设置每个文本框的值 |
|
textareas.forEach((textarea, index) => { |
|
info += `Textarea ${index}: ${textarea.className}\n`; |
|
textarea.value = "Hi! Create a image."; |
|
// 触发input事件以确保Gradio检测到变化 |
|
textarea.dispatchEvent(new Event('input', { bubbles: true })); |
|
}); |
|
|
|
inputs.forEach((input, index) => { |
|
info += `Input ${index}: ${input.className}\n`; |
|
input.value = "Hi! Create a image."; |
|
input.dispatchEvent(new Event('input', { bubbles: true })); |
|
}); |
|
|
|
debugInfo.textContent = info; |
|
debugInfo.style.display = 'block'; // 显示调试信息 |
|
} |
|
|
|
// 等待一段时间后执行 |
|
setTimeout(() => { |
|
setDefaultText(); |
|
// 如果第一次不成功,再试一次 |
|
setTimeout(setDefaultText, 1000); |
|
}, 2000); |
|
</script> |
|
""") |
|
|
|
|
|
with gr.Row(): |
|
gr.Markdown(""" |
|
**Best AI Tools** |
|
[Nude AI](https://nudeai.beauty) • [Uncensored AI](https://uncensoredai.cc) • [AI Hentai Generator](https://aihentaigenerator.fun) • [Stable Diffusion Hentai](https://stable-diffusion-hentai.aihentaigenerator.fun) • [Bing Image Creator](https://bingimagecreator.online) • [NSFW AI Art](https://nsfwaiart.art) • [NSFW AI Chatbot](https://nsfw-ai-chatbot.online) • [NSFW AI World](https://nsfwai.world) • [AI Tools Directory](https://aitoolsdirectory.online) • [Viggle AI](https://viggleai.live) • [TDEE Calculator](https://tdeecalculator.online) • [Calculator App](https://calculatorapp.online) • [Compound Interest Calculator](https://compoundinterestcalculator.site) • [AI Story Generator](https://aistorygenerator.fun) • [Llama AI](https://llamaai.online) • [AI Art Free](https://aiartfree.online) • [Cek Khodam](https://cekkhodam.co) • [AI Detector](https://ai-detector.online) • [AI Cover](https://aicover.fun) • [Flux AI](https://flux-ai.online) • [Brat Generator](https://bratgenerator.org) • [AI Text Generator](https://aitextgenerator.live) • [Black Myth Wukong](https://blackmythwukong.buzz) • [Book Summary](https://booksummary.wiki) • [ChatGPT Gratuit](https://chatgptgratuit.chat) • [ChatGPT Online](https://chatgtponline.com) • [Gau Thai](https://gauthai.pro) • [Best Recipe](https://bestrecipe.pro) |
|
**Games** |
|
[Cookie Clicker Unblocked](https://cookie-clicker-unblocked.pro) • [Freaky Font](https://freakyfont.org) • [Chat Gratuito](https://chatgratuito.online) • [Incredibox Sprunki](https://incrediboxsprunki.pro) • [Moto X3M Unblocked](https://motox3munblocked.pro) • [Parkour Civilization](https://parkourcivilization.pro) • [Sled Rider 3D](https://sledrider3d.com) • [Snow Rider 3D](https://snow-rider-3d.pro) • [Sprunki Game](https://sprunkigame.pro) • [Stickman Hook Unblocked](https://stickmanhookunblocked.pro) |
|
|
|
""") |
|
|
|
|
|
demo.launch() |