Giter Club home page Giter Club logo

pollinations's Introduction

License Python Versions

Pollinations are an effort to make generative art more approachable.

  • A frontend hosting a set of curated notebooks that allow creating and experimenting with generative art.
  • The Interplanetary Filesystem (IPFS) for decentralized censorship-resistant storage of models, code and generated content
  • Pollinations are run on Google Colab at the moment (for the free cloud GPUs)

Instructions on using Pollinations.AI.

🐍 Python Package

# Usage Example

import pollinations as ai

model: object = ai.Model()

image: object = model.generate(
    prompt=f'Golden retriever puppy playing in the rain {ai.realistic}',
    model=ai.turbo,
    height=512,
    seed=57184
)
image.save('image-output.jpg')

print(image.url)
// >>> https://image.pollinations.ai/prompt/Golden%20retriever%20puppy%20playing%20in%20the%20rain%20realistic,%20realism,%20real%20life,%20ultra%20realistic,%20high%20quality,%20real?model=turbo&width=1024&height=512&seed=57184

image

οΏ½πŸ‘©β€πŸ’» Development (outdated)

Development of Pollinations.AI Web App
`make dev` to start the development server of web app.% 

Enable logging:
`localStorage.debug = "*"`

If logs don't appear in Chrome enable logging "All Aevels" (including Verbose)


## Optionally it is possible to develop with a local IPFS node

Enable connect to local IPFS:
`localStorage.localIFS = true

`make up` to start the releant services. See next section for details
Development of Notebooks

All notebooks at pollinations/hive are automatically deployed to Pollinations.

We will add an easy way to include custom notebooks. For now, to use an external notebook it needs to be uploaded to IPFS wrapped in a folder in the form input/notebook.ipynb. The resulting IPFS hash can be used directly like so: https://pollinations.ai/p/[hash]

Development with Local IPFS node
Development environment requires `docker` & `docker-compose` for running a loca IPFS node. For docker installation, please navigate to https://docs.docker.com/get-docker/.

After docker is setup, `make` is used for managing the IPFS and development environment.

## 🟑 Initialization

To run pollinations development environment first time,

- Run `make init`, this will initialize start the IPFS docker image and fill `tmp/ipfs` folder by migrating IPFS.

## 🟒 Running

After IPFS migrated, to start development environment,
- Run `make up`, this will start the dockerized IPFS instance and detach.
- Run `make dev` to start the react application living under `/app`

## πŸ”΄ Stopping

- Run `make down` to stop running IPFS instance.
- Run `make clean` to remove the `tmp` folder and its contents.

## βš™οΈ Configuration

IPFS configuration can be found and updated in `docker/ipfs/config.json`. Every time the docker containers are started, the config file under `tmp/ipfs/config` is overwritten with this json file.
Architecture Diagram

The following diagram has an editable copy embedded. Use https://draw.io/#Hpollinations/pollinations/master/pollinations_architecture.png to edit the file.

Export the results as PNG with "Include a copy of my diagram" option selected and replace the current diagram.

Architecture Diagram

πŸ”— Links

pollinations's People

Contributors

ale-rls avatar alexreiling avatar carlospablov avatar elliotetag avatar flowa-ai avatar gbechtel12 avatar gokaykucuk avatar lauraibnz avatar nielsrolf avatar voodoohop avatar zxyra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pollinations's Issues

State Management Discussion

im in a bit of a decision with the state management...

at the moment we have one "global" shared state in the form of an ipfs hash
the state can be seen as a json object or a folder structure
on the colab side the IPFS state is persisted directly to and from the file system
the colab writes to /output pollinations writes to /input
and whenever either has changed the global state it sends a new hash on a pubsub channel
but its not so clean because both can change either /input or /output its not completely unidirectional data flow
so im thinking the colab notebook should only send its output content id and pollinations should only send the input content id
but then i loose the niceness of having one hash
that describes the whole run including inputs and outputs

Opt-in for social media posting

As of now I see that the results are posted to various accounts once the notebook is complete. I have two suggestions regarding this.

  • At minimum, the user should be aware that posts are being made (there could be sensitive information used as prompts for generation)
  • This functionality should be opt-in with a toggle next to "Submit"

Pollinator Improvements

  • Fix last files added to the folder not being synced to IPFS properly
  • Fix notebook logging to $ipfs_root/output/log. (We use the log to display a progress bar depending on the currently executing cell)

Keep-Alive Signal from Colab

Send IPFS CID every few seconds to pollinations. If pollinations doesn't receive for x seconds it should display a modal to restart then runtime

Simplify Pollinations <-> IPFS <-> Colab communication

Implement unidirectional data-flow.

All state is still stored in IPFS.

Colab notebook will be only allowed to write to /output and read from /input.

Pollinations will be only allowed to write to /input and read from /output

Demo Notebooks

  • add superresolution step to clip to clip-guided diffusion notebook #43
  • use .jpegs as intermediary format to save space
  • factor out superresolution and video creation. add them to a pollinations pip package

UI cleanup

  • Move node and content id into nav bar
  • Show help button more 0656da6
  • Help modal is not scrollable depending on screen size

Screenshot 2021-08-01 at 16 40 20

A simpler, more approachable message on social posts

The current message on social posts is too technical for most people to understand.
e.g.

CLIP+VQGAN (Text-to-Image): Falling water and moon in the style of Salvador DalΓ­. https://pollinations.ai/p/QmT8o7NdfMXigJmV1Hk4VoEbTPYhp1KCZvLBTPW8uP2wNF

A more approachable version like the following might make them easier to understand and can create more interaction.

Hey, I just painted(or animated) 'Falling water and moon in the style of Salvador DalΓ­.', just from this text. If you want to learn more about 'Deep Learning' and how computers can 'imagine' you can learn more at: bit.ly/pollinations-learn-more.

Sharing URL's are too long.

The result pages have too long and cryptic URLs.

We can create a simple url shortener with a short domain name with serverless, so we can let users use a more user-friendly URL.


https://pollinations.ai/p/Qmf3RViTYAoSfFpqtzADUKettXaXvCjnnw77dHoAAuEKCm -> plns.ai/3TgfR or pollinations.ai/3TgfR

We can still use the current domain and add the redirection service to the domain.

We might also let users "name" their creations, giving them a custom URL under the chosen domain.
This naming can also be used to "pin" only named creations on our IPFS node which might filter out most of the noise.


plns.ai/DreamyMorning

It can even be a really cheap but paid feature, something like few dollars per year. Or maybe this can kick in after a certain number of (ex. 3) custom names are created, we can ask for something like 1$/ per 1000 for custom names.

Also even if the short URLs are sold, this feature should be not secured. If someone doesn't want to pay, they should just be able to clear cookies/reset browser cache/delete localStorage etc to get another 10 free url's.

This entire setup can be also done with NFT's as owners of these urls.

usage information

The process became a bit more stable and simpler. There is no more cancel or reset button. Also the modal window is not scrollable on mobile I think

[Bug] After pressing cancel button, inputs at pollinations.ai disappeared

After running and receiving the video output of one run, I pressed the "stop" button to run another input. At this point the website became unresponsive. After refreshing the page, all the "input"s disappeared from pollinations.ai and the system got into an unusable state.

https://pollinations.ai/ipfs/QmaXCvUxwvQiPrLmBeTEiqaA9N2Y319pqVwo92aet1TQr2

After some inspection, it seems like the output folder has "status='running'" while input has "formAction=cancel".

Advanced mode for more settings for experienced users

In the current iteration, the interaction the user has with the params of the model are quite limited. It would make sense for more experienced users to have some ability to change additional params with an "Advanced mode" toggle that would reveal other settings that were hidden (temperature, iteration count, save count, and others).

Social Media Posting

  • figure out how to specify a thumbnail image for the video (easiest is to copy the final frame to the first frame maybe)
  • Resize video in ffmpeg to be portable on Instagram and twitter
  • Show links to posted content when done
  • add checkbox to disable posting
  • Meta tags SSR not working properly. from #34
  • move call of netlify function to frontend. separate per social network
  • make social media posting optional (add checkbox)
  • Only apply maturity filter to whole words
  • Change maturity filter to *** words instead of filtering the posts
  • Maturity filter
  • Shorten title for twitter #51
  • Show social media icons in menu for people to find the feeds even without creating anything
    the thumbnail is a bit annoying if its the first frame since these models start from noise
  • Separate serverless function that fetches IPFS state from function that does post. Use redirect

Simpify and separate IPFS handling

Idea:

input: ipfs hash of the whole /input folder
output: stream of ipfs hashes of the whole /input + /output folder

the input folder only needs to contain a run.sh script which would start Papermill in the case of running a colab notebook but can also be more simple cli-based sequences of commands. All they need to follow is copy from a predetermined input folder and write outputs to a predetermined output folder.

Gallery

-> Store a history of created pollinations in browser localStorage to show.

Adult filter sometimes filters too much.

All my life, my parents have told me not to open the ba******t door, but I got curious and disobeyed them.

Here, it's just "semen" which is removed but actually it should not. I don't have a solution right now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.