Pushibus mit ImageMaster3000
This commit is contained in:
32
KIKunstKirstenKlöckner/wwwroot/scripts/ImageMaster3000.js
Normal file
32
KIKunstKirstenKlöckner/wwwroot/scripts/ImageMaster3000.js
Normal file
@ -0,0 +1,32 @@
|
||||
import { HfInference } from 'https://cdn.jsdelivr.net/npm/@huggingface/inference@2.6.1/+esm';
|
||||
import { createRepo, commit, deleteRepo, listFiles } from "https://cdn.jsdelivr.net/npm/@huggingface/hub@0.8.4/+esm";
|
||||
|
||||
async function DoSexyStuff(prompt)
|
||||
{
|
||||
const HF_ACCESS_TOKEN = "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";
|
||||
|
||||
const inference = new HfInference(HF_ACCESS_TOKEN);
|
||||
|
||||
const blob = await inference.textToImage({
|
||||
//model: 'stabilityai/stable-diffusion-2',
|
||||
model: 'Nacken/ki-kunst-kirsten-kloeckner-colab',
|
||||
//inputs: 'award winning high resolution photo of a giant tortoise/((ladybird)) hybrid, [trending on artstation]',
|
||||
inputs: prompt,
|
||||
parameters: {
|
||||
negative_prompt: 'blurry',
|
||||
}
|
||||
})
|
||||
|
||||
const imageUrl = window.URL.createObjectURL(blob);
|
||||
|
||||
return imageUrl;
|
||||
|
||||
//window.open(imageUrl, '_blank');
|
||||
}
|
||||
|
||||
// Exportiere die Funktion in den globalen Kontext
|
||||
window.DoSexyStuff = DoSexyStuff;
|
||||
|
||||
function showAlert(message) {
|
||||
alert(message);
|
||||
}
|
||||
Reference in New Issue
Block a user