-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New plugin: AI Image Generator #5378
Comments
@nqst there are currently no loading and error states. What happens when "Edit with AI" or Remove "bg" take 20 seconds? Or fail? Can we add some designs for that? |
Absolutely! I'll add these. |
We should also consider splitting this issue into two: image editor changes and the new plugin. They can be worked on separately and are quite different things to build. |
Even if https://github.com/transloadit/team-internals/issues/339 isn't finished yet, we could already leverage Replicate.com/Fal.ai as suggested here. And then use FLUX, while we don't support it yet. This seemed to be hard, what's the status of this Merlijn? Tim and I would like to push for this |
By only relying on It's 80% done with just 50 lines of code. Screen.Recording.2024-09-02.at.11.21.20.mov search = async () => {
const transloadit = this.uppy.getPlugin<Transloadit<M, B>>('Transloadit')
if (!transloadit) {
throw new Error('ImageGenerator requires the Transloadit plugin')
}
this.uppy.on('transloadit:result', (stepName, result) => {
// TODO: use a deterministic property to get the right result,
// not stepName which can be changed by the implementer of the template.
if (stepName === 'resized') {
const { results } = this.getPluginState()
this.setPluginState({ results: [...results, result] })
}
})
try {
await this.uppy.upload()
} finally {
// Normally uppy.upload() is only used to upload your files
// but here we need it to _get_ the results from the AI image generator Robot.
// That means users who set `allowMultipleUploadBatches: false` will not
// be able to actually upload their files, so we reset the state here.
this.uppy.setState({ allowNewUpload: true })
}
}
private onCheckboxChange = (result: AssemblyResult) => {
const { checkedResultIds } = this.getPluginState()
if (checkedResultIds.has(result.id)) {
checkedResultIds.delete(result.id)
} else {
checkedResultIds.add(result.id)
}
this.setPluginState({ checkedResultIds })
}
private donePicking = () => {
const { checkedResultIds, results } = this.getPluginState()
const files = results
.filter((result) => checkedResultIds.has(result.id))
.map((result) => ({
name: result.name,
data: { size: result.size },
}))
this.uppy.addFiles(files)
} |
Initial checklist
Problem
We want to enhance Uppy's functionality by adding AI features. The first candidates are AI image generation and background removal.
Solution
Here are the screenshots of the new AI image generator feature. This includes the updated Image editor (see #5407), which looks much lighter, and adds the "Edit with AI" and "Remove background" features.
These screenshots are likely not final, and the mobile version is not ready yet. Comments and suggestions are welcome!
The text was updated successfully, but these errors were encountered: